simd-math icon indicating copy to clipboard operation
simd-math copied to clipboard

about header vector_size.hpp compatibility with cuda

Open pkestene opened this issue 4 years ago • 0 comments

Hi,

If I try to build e.g. simd_warp_solution.cpp (from Kokkos-tutorial), with nvcc 11.4 and g++-10.2, i get several compile error, e.g. :

/home/pkestene/etudes/kokkos/github/test/simd-math/vector_size.hpp(149): error: attribute does not apply to any entity

/home/pkestene/etudes/kokkos/github/test/simd-math/vector_size.hpp(178): error: "simd::simd<T, simd::simd_abi::vector_size<N>> () const" contains a vector, which is not supported in device code

2 errors detected in the compilation of "/home/pkestene/etudes/kokkos/github/test/simd_warp_solution.cpp".

It builds and runs fine if I protect including vector_size.hpp in simd.hpp when building for Cuda:

// iprevent including vector_size when building for cuda ?
#ifndef __CUDACC__
#include "vector_size.hpp"
#endif

Is it ok ?

pkestene avatar Oct 21 '21 01:10 pkestene