-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add thrust/PSTL example with particles and tracks
TODO: includes massive hacks to LLAMA. Using a custom fork of thrust to fix supporting proxy references.
- Loading branch information
1 parent
75cb6fb
commit 55a91cf
Showing
8 changed files
with
771 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "examples/raycast/Sponza"] | ||
path = examples/raycast/Sponza | ||
url = https://github.com/jimmiebergmann/Sponza | ||
[submodule "thirdparty/thrust"] | ||
path = thirdparty/thrust | ||
url = https://github.com/bernhardmgruber/thrust.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
cmake_minimum_required (VERSION 3.15) | ||
project(llama-thrust CXX CUDA) | ||
|
||
set (Thrust_DIR "../../thirdparty/thrust/thrust/cmake/") | ||
find_package(Thrust REQUIRED CONFIG) | ||
thrust_create_target(Thrust FROM_OPTIONS) | ||
find_package(OpenMP REQUIRED) | ||
if (NOT TARGET llama::llama) | ||
find_package(llama REQUIRED) | ||
endif() | ||
add_executable(${PROJECT_NAME} thrust.cu ../common/Stopwatch.hpp ../common/hostname.hpp) | ||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) | ||
target_compile_options(${PROJECT_NAME} PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:--expt-extended-lambda --expt-relaxed-constexpr --use_fast_math --ftemplate-backtrace-limit 500>) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE llama::llama Thrust OpenMP::OpenMP_CXX) | ||
|
||
# OpenMP is not added to the compiler commandline by cmake when using nvcc .. | ||
if (NOT MSVC) | ||
find_package(TBB REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE TBB::tbb) | ||
target_compile_options(${PROJECT_NAME} PUBLIC -Xcompiler -march=native -ffast-math -fopenmp) | ||
else() | ||
target_compile_options(${PROJECT_NAME} PUBLIC -Xcompiler /openmp) | ||
endif() |
Oops, something went wrong.