File tree 8 files changed +779
-14
lines changed
8 files changed +779
-14
lines changed Original file line number Diff line number Diff line change 1
1
[submodule "examples/raycast/Sponza "]
2
2
path = examples/raycast/Sponza
3
3
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 @@ -87,6 +87,7 @@ if (LLAMA_BUILD_EXAMPLES)
87
87
add_subdirectory ("examples/bytesplit" )
88
88
add_subdirectory ("examples/bitpackint" )
89
89
add_subdirectory ("examples/bitpackfloat" )
90
+ add_subdirectory ("examples/thrust" )
90
91
91
92
# alpaka examples
92
93
find_package (alpaka 0.7.0 QUIET )
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