Open amklinv-nnl opened 2 years ago
For line 8 , can you try RAJA::cuda_exec
It looks like your code is being compiled as CXX, you need to compile it as CUDA device code, e.g. with nvcc. For CMake, you can try:
set_source_file_properties(main.cpp PROPERTIES LANGUAGE CUDA)
and make sure that you have CUDA
in the LANGUAGES
section of the CMake project
command.
Thank you for the advice. I now get an error about --extended-lambda. Have I configured raja incorrectly, or is this something I have to manually add to my flags?
[ 50%] Building CUDA object CMakeFiles/axpy.dir/main.cpp.o
/home/amklinv/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-11.2.0/cuda-11.4.4-7vyozxcmd5tsqdtugol7sc26ydzstqop/bin/nvcc -forward-unknown-to-host-compiler -DCAMP_HAVE_CUDA -isystem=/home/amklinv/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-11.2.0/umpire-6.0.0-vzkbb7g3yc57jqa5xwodjynhrx5z2azs/include -isystem=/home/amklinv/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-11.2.0/chai-2.4.0-6rvkhgeq3bqku2nztmx5vt6co6wxbp5o/include -isystem=/home/amklinv/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-11.2.0/raja-0.14.0-y5e33jodwbkc3xvhykcz6bwfb44q42ch/include -isystem=/home/amklinv/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-11.2.0/cuda-11.4.4-7vyozxcmd5tsqdtugol7sc26ydzstqop/include -isystem=/home/amklinv/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-11.2.0/camp-0.2.2-uh6zbbsk2gjaoxw4lucog7venptpovbw/include -Xcompiler=-fopenmp -std=c++17 -MD -MT CMakeFiles/axpy.dir/main.cpp.o -MF CMakeFiles/axpy.dir/main.cpp.o.d -x cu -c /home/amklinv/gpu-programming-models/main/axpy/main.cpp -o CMakeFiles/axpy.dir/main.cpp.o
/home/amklinv/gpu-programming-models/main/axpy/main.cpp(23): error: __host__ or __device__ annotation on lambda requires --extended-lambda nvcc flag
You shouldn't have to add the --extended-lambda flag. We add it here: https://github.com/LLNL/RAJA/blob/develop/cmake/SetupCompilers.cmake#L46
I am trying to compile the following code based on a raja vector sum example.
However, I get a build error:
My spack spec for raja:
raja@0.14.0+cuda~examples~exercises~ipo+openmp~rocm+shared~tests build_type=RelWithDebInfo cuda_arch=75
Am I missing something?