Fix for the HIP build+test errors.

The errors were introduced by this commit :

After the above mentioned commit, some of the tests started failing with the following error


```
Built target cxx11_tensor_reduction
Building HIPCC object unsupported/test/CMakeFiles/cxx11_tensor_reduction_gpu_5.dir/cxx11_tensor_reduction_gpu_5_generated_cxx11_tensor_reduction_gpu.cu.o
In file included from /home/rocm-user/eigen/unsupported/test/cxx11_tensor_reduction_gpu.cu:16:
In file included from /home/rocm-user/eigen/unsupported/Eigen/CXX11/Tensor:117:
/home/rocm-user/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorBlockV2.h:155:5: error: the field type is not amp-compatible
    DestinationBufferKind m_kind;
    ^
/home/rocm-user/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorBlockV2.h:211:3: error: the field type is not amp-compatible
  DestinationBuffer m_destination;
  ^
```


For some reason HIPCC does not like device code to contain enum types which do not have the base-type explicitly declared. The fix is trivial, explicitly state "int" as the basetype
This commit is contained in:
Deven Desai 2019-10-22 19:21:27 +00:00
parent df0e8b8137
commit 102cf2a72d

View File

@ -80,7 +80,14 @@ class TensorBlockDescriptor {
// evaluated expression scalar type. // evaluated expression scalar type.
class DestinationBuffer { class DestinationBuffer {
public: public:
enum DestinationBufferKind { enum DestinationBufferKind : int {
// The above explicit specification of "int" as the enum basetype is needed
// to get around a HIPCC link error ("the field type is not amp-compatible")
// which is issued for class members with the enum type.
// TODO(rocm):
// remove the "int" basetype once HIPCC has been fixed to not error out
// in the above scenario.
// Destination buffer is not defined (`m_data` == nullptr). // Destination buffer is not defined (`m_data` == nullptr).
kEmpty, kEmpty,