Comments (4)
@davidbeckingsale. Thanks for the suggestions. I had to add set(CMAKE_CUDA_HOST_COMPILER gcc)
and set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda")
in addition to your suggestions to get it working.
Here is the final CMakeLists.txt
that worked for me.
cmake_minimum_required(VERSION 3.17)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(THIS raja-example)
project(${THIS})
enable_language(CUDA)
set(CMAKE_CUDA_HOST_COMPILER gcc)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)
find_package(RAJA REQUIRED)
set(SOURCE main.cpp)
set_source_files_properties(${SOURCE} PROPERTIES LANGUAGE CUDA)
add_executable(${THIS} ${SOURCE})
target_link_libraries(${THIS} PRIVATE RAJA)
I used cmake ../
and found that -DENABLE_CUDA=ON
did nothing.
from raja.
How did you run CMake to configure the build for your project? Did you pass -DENABLE_CUDA=On
?
from raja.
@rhornung67 thanks for the suggestion. However when I do cmake -DENABLE_CUDA=On ../
, I get this warning from cmake
CMake Warning:
Manually-specified variables were not used by the project:
ENABLE_CUDA
If I go ahead and run make anyway, I get the same error:
/home/cyenusah/Project/hpc-heterogeneous-computing/src/daxpy/raja/raja_example/main.cpp: In function ‘int main(int, char**)’:
/home/cyenusah/Project/hpc-heterogeneous-computing/src/daxpy/raja/raja_example/main.cpp:37:24: error: ‘cuda_exec’ in namespace ‘RAJA’ does not name a template type
37 | using policy = RAJA::cuda_exec<256>;
from raja.
It looks like your example is using CUDA, so you will need to tell CMake to compile your main.cpp file with CUDA, e.g.:
set_source_files_properties(main.cpp PROPERTIES LANGUAGE CUDA)
You will also need to add enable_language(CUDA)
to your CMakeLists
from raja.
Related Issues (20)
- Review disabled tests
- fix SYCL example
- Remove set/getQueue methods for SYCL, part 1
- Compilation issue with new clang/Intel HOT 3
- Remove SYCL set/getQueue methods, part 2
- Atomics wishlist HOT 1
- Improving RAJA integration with perf tools HOT 1
- Add SYCL support for scan
- Add sort support for SYCL
- OpenMP Target CI Checks
- Require explicit initialization values for reductions
- Reduce redundant code in examples
- error: ‘CudaKernel’ is not a member of ‘RAJA::statement’ HOT 5
- Add examples with gpu global indexing for both kernel and launch
- Update CI compilers
- Update User and Dev Guides
- SYCL reduction support
- Support new reduction interface in RAJA::kernel
- Improve RAJA layout documentation when using unit stride
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raja.