You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cuda compilation issue described in #308 seems to be due to the missing template specialization of HeffteBackendType<Kokkos::HostSpace> when building with cuda.
The issue only arrives when compiling the unit tests for FFT. It is my understanding that the unit tests allocate memory on the host as well as the cuda device. The allocation on the host device is used for comparing the results of the FFT with the ground truth. This requires both specializations HeffteBackendType<Kokkos::HostSpace> and HeffteBackendType<Kokkos::CudaSpace> to exist.
In src/FFT/FFT.h, we conditionally generate the HeffteBackendType<Kokkos::HostSpace> but one of the conditions is !defined(KOKKOS_ENABLE_CUDA). So when we build for CUDA, this specialization is omitted.
Proposed solution
Remove the !defined(KOKKOS_ENABLE_CUDA) part of the condition.
- #if !defined(KOKKOS_ENABLE_CUDA) && !defined(Heffte_ENABLE_MKL) && !defined(Heffte_ENABLE_FFTW)+ #if !defined(Heffte_ENABLE_MKL) && !defined(Heffte_ENABLE_FFTW)
/**
* Use heFFTe's inbuilt 1D fft computation on CPUs if no
* vendor specific or optimized backend is found
*/
template <>
struct HeffteBackendType<Kokkos::HostSpace> {
using backend = heffte::backend::stock;
using backendSine = heffte::backend::stock_sin;
using backendCos = heffte::backend::stock_cos;
using backendCos1 = heffte::backend::stock_cos1;
};
#endif
When removing this part of the condition, the unit tests compile without issue. This was tested on Gwendolen.
The text was updated successfully, but these errors were encountered:
Cause of the problem
The cuda compilation issue described in #308 seems to be due to the missing template specialization of
HeffteBackendType<Kokkos::HostSpace>
when building with cuda.The issue only arrives when compiling the unit tests for FFT. It is my understanding that the unit tests allocate memory on the host as well as the cuda device. The allocation on the host device is used for comparing the results of the FFT with the ground truth. This requires both specializations
HeffteBackendType<Kokkos::HostSpace>
andHeffteBackendType<Kokkos::CudaSpace>
to exist.In
src/FFT/FFT.h
, we conditionally generate theHeffteBackendType<Kokkos::HostSpace>
but one of the conditions is!defined(KOKKOS_ENABLE_CUDA)
. So when we build for CUDA, this specialization is omitted.Proposed solution
Remove the
!defined(KOKKOS_ENABLE_CUDA)
part of the condition.When removing this part of the condition, the unit tests compile without issue. This was tested on Gwendolen.
The text was updated successfully, but these errors were encountered: