File tree Expand file tree Collapse file tree 8 files changed +779
-14
lines changed
Expand file tree Collapse file tree 8 files changed +779
-14
lines changed Original file line number Diff line number Diff line change 11[submodule "examples/raycast/Sponza "]
22 path = examples/raycast/Sponza
33 url = https://github.com/jimmiebergmann/Sponza
4+ [submodule "thirdparty/thrust "]
5+ path = thirdparty/thrust
6+ url = https://github.com/bernhardmgruber/thrust.git
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ if (LLAMA_BUILD_EXAMPLES)
167167 add_subdirectory ("examples/stream" )
168168 add_subdirectory ("examples/falsesharing" )
169169 add_subdirectory ("examples/comptime" )
170+ add_subdirectory ("examples/thrust" )
170171
171172 # alpaka examples
172173 find_package (alpaka 1.0)
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.15)
2+ project (llama-thrust CXX CUDA)
3+
4+ set (Thrust_DIR "../../thirdparty/thrust/thrust/cmake/" )
5+ find_package (Thrust REQUIRED CONFIG)
6+ thrust_create_target(Thrust FROM_OPTIONS)
7+ find_package (OpenMP REQUIRED)
8+ if (NOT TARGET llama::llama)
9+ find_package (llama REQUIRED)
10+ endif ()
11+ add_executable (${PROJECT_NAME} thrust.cu ../common/Stopwatch.hpp ../common/hostname.hpp)
12+ target_compile_features (${PROJECT_NAME} PRIVATE cxx_std_17)
13+ target_compile_options (${PROJECT_NAME} PUBLIC
14+ $<$<COMPILE_LANGUAGE:CUDA>:
15+ -forward-unknown-to-host-compiler
16+ --expt-extended-lambda
17+ --expt-relaxed-constexpr
18+ --use_fast_math
19+ --ftemplate-backtrace-limit 500>)
20+ target_link_libraries (${PROJECT_NAME} PRIVATE llama::llama Thrust OpenMP::OpenMP_CXX)
21+
22+ # OpenMP is not added to the compiler commandline by cmake when using nvcc ..
23+ if (NOT MSVC )
24+ find_package (TBB REQUIRED)
25+ target_link_libraries (${PROJECT_NAME} PRIVATE TBB::tbb)
26+ target_compile_options (${PROJECT_NAME} PUBLIC -march=native -ffast-math -fopenmp)
27+ else ()
28+ target_compile_options (${PROJECT_NAME} PUBLIC /openmp)
29+ endif ()
You can’t perform that action at this time.
0 commit comments