Alpaka: Unit Test atomic can not be compiled with CUDA

Created on 8 Jun 2018  路  8Comments  路  Source: alpaka-group/alpaka

The test case is not compiling if CUDA is available

$ cmake alpaka/test/unit/atomic/
$ make
[ 20%] Building CXX object CMakeFiles/common.dir/alpaka/test/common/src/Dummy.cpp.o
[ 40%] Linking CXX static library libcommon.a
[ 40%] Built target common
[ 80%] Building NVCC (Device) object CMakeFiles/atomic.dir/src/atomic_generated_AtomicTest.cpp.o
[ 80%] Building NVCC (Device) object CMakeFiles/atomic.dir/src/atomic_generated_main.cpp.o
alpaka/include/alpaka/atomic/AtomicCudaBuiltIn.hpp(108) Error: unsupported operation

CMake Error at atomic_generated_AtomicTest.cpp.o.cmake:279 (message):
  Error generating file
  /bigdata/hplsim/scratch/widera/buildAlpaka/CMakeFiles/atomic.dir/src/./atomic_generated_AtomicTest.cpp.o
module li
Currently Loaded Modulefiles:
  1) gcc/5.3.0              4) cuda/8.0               7) pngwriter/0.7.0
  2) cmake/3.10.1           5) openmpi/2.1.2.cuda80   8) hdf5-parallel/1.8.20
  3) boost/1.62.0           6) zlib/1.2.8             9) libsplash/1.7.0
CUDA Bug Testing

All 8 comments

This test has some special casing for CUDA. The other accelerators support many different primitive types for atomic operations, but CUDA should be checked only for std::uint32_t. At least this is what I intended with the code in AtomicTest.cpp.

I am currently investigating this issue and found a first mistake. The test is only executed with std::int32_t in CI but it is only enabled for CUDA when std::uint32_t is selected. So compilation of the atomic test had been disabled for CUDA in the CI...

I have done some tests in CI and for now I can say that the error is limited to sm_20 which is only available in CUDA 8.0. I will try to figure out more.

It seems to be a nvcc problem. Clang with CUDA 8.0 and sm_20 works.

Hmm... It is not even related to sm_20. It does not work with sm_30 or sm_35 either. Furthermore, it does not seem to be related to atomicAdd. Other atomic operations (e.g. atomicMin) do also fail.

It fails with gcc 4.9 as well as gcc 5.0 in release and in debug builds.

Ah... It may be related to the usage of local variables as target of the atomic operation. Atomics on registers do not seem to be supported by nvcc 8.0. I will try to fix this.

My test is green now. I will provide a fixed test.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ax3l picture ax3l  路  4Comments

psychocoderHPC picture psychocoderHPC  路  5Comments

jkelling picture jkelling  路  4Comments

jkelling picture jkelling  路  3Comments

BenjaminW3 picture BenjaminW3  路  3Comments