From 636e2bb3fa147c98e9fe96971c4f0560ba132ff2 Mon Sep 17 00:00:00 2001 From: Deven Desai Date: Fri, 20 Dec 2019 21:28:00 +0000 Subject: Fix for HIP breakage - 191220 The breakage was introduced by the following commit : https://gitlab.com/libeigen/eigen/commit/ae07801dd8d295657f28b006e1e4999edf835052 After the commit, HIPCC errors out on some tests with the following error ``` Building HIPCC object unsupported/test/CMakeFiles/cxx11_tensor_device_1.dir/cxx11_tensor_device_1_generated_cxx11_tensor_device.cu.o In file included from /home/rocm-user/eigen/unsupported/test/cxx11_tensor_device.cu:17: In file included from /home/rocm-user/eigen/unsupported/Eigen/CXX11/Tensor:100: /home/rocm-user/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h:129:12: error: no matching constructor for initialization of 'Eigen::internal::TensorBlockResourceRequirements' return {merge(lhs.shape_type, rhs.shape_type), // shape_type ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rocm-user/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h:75:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided struct TensorBlockResourceRequirements { ^ /home/rocm-user/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h:75:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 3 were provided /home/rocm-user/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h:75:8: note: candidate constructor (the implicit copy constructor) not viable: requires 5 arguments, but 3 were provided /home/rocm-user/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h:75:8: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 3 were provided ... ... ``` The fix is to explicitly decalre the (implicitly called) constructor as a device func --- unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h index e89f40213..ba395f06d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h @@ -77,6 +77,17 @@ struct TensorBlockResourceRequirements { size_t size; // target block size TensorOpCost cost_per_coeff; // cost of computing a single block element +#ifdef EIGEN_HIPCC + // For HIPCC, we need to explicitly declare as a "device fun", the constructor + // which is implicitly invoked in the "merge" / "any" routines. else HIPCC + // errors out complaining about the lack of a matching constructor + EIGEN_DEVICE_FUNC + TensorBlockResourceRequirements(TensorBlockShapeType shape_type_, size_t size_, + TensorOpCost cost_) + : shape_type(shape_type_), size(size_), cost_per_coeff(cost_) + {} +#endif + template EIGEN_DEVICE_FUNC static TensorBlockResourceRequirements withShapeAndSize( TensorBlockShapeType shape_type, size_t size_in_bytes, -- cgit v1.2.3