Skip to content

Commit

Permalink
Modify according bretbrownjr's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
HungMingWu committed Sep 21, 2024
1 parent 22ddff5 commit dfb8e7d
Showing 1 changed file with 55 additions and 34 deletions.
89 changes: 55 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,33 +207,6 @@ PUBLIC
include/exec/trampoline_scheduler.hpp
include/exec/variant_sender.hpp
include/exec/when_any.hpp
include/nvexec/detail/config.cuh
include/nvexec/detail/cuda_atomic.cuh
include/nvexec/detail/cuda_fwd.cuh
include/nvexec/detail/memory.cuh
include/nvexec/detail/queue.cuh
include/nvexec/detail/throw_on_cuda_error.cuh
include/nvexec/detail/variant.cuh
include/nvexec/multi_gpu_context.cuh
include/nvexec/nvtx.cuh
include/nvexec/stream/algorithm_base.cuh
include/nvexec/stream/bulk.cuh
include/nvexec/stream/common.cuh
include/nvexec/stream/ensure_started.cuh
include/nvexec/stream/launch.cuh
include/nvexec/stream/let_xxx.cuh
include/nvexec/stream/reduce.cuh
include/nvexec/stream/schedule_from.cuh
include/nvexec/stream/split.cuh
include/nvexec/stream/start_detached.cuh
include/nvexec/stream/submit.cuh
include/nvexec/stream/sync_wait.cuh
include/nvexec/stream/then.cuh
include/nvexec/stream/transfer.cuh
include/nvexec/stream/upon_error.cuh
include/nvexec/stream/upon_stopped.cuh
include/nvexec/stream/when_all.cuh
include/nvexec/stream_context.cuh
include/stdexec/__detail/__as_awaitable.hpp
include/stdexec/__detail/__awaitable.hpp
include/stdexec/__detail/__basic_sender.hpp
Expand All @@ -242,7 +215,7 @@ PUBLIC
include/stdexec/__detail/__concepts.hpp
include/stdexec/__detail/__config.hpp
include/stdexec/__detail/__connect_awaitable.hpp
include/stdexec/__detail/__continue_on.hpp
include/stdexec/__detail/__continues_on.hpp
include/stdexec/__detail/__cpo.hpp
include/stdexec/__detail/__debug.hpp
include/stdexec/__detail/__diagnostics.hpp
Expand Down Expand Up @@ -282,7 +255,7 @@ PUBLIC
include/stdexec/__detail/__spin_loop_pause.hpp
include/stdexec/__detail/__split.hpp
include/stdexec/__detail/__start_detached.hpp
include/stdexec/__detail/__start_on.hpp
include/stdexec/__detail/__starts_on.hpp
include/stdexec/__detail/__stop_token.hpp
include/stdexec/__detail/__stopped_as_error.hpp
include/stdexec/__detail/__stopped_as_optional.hpp
Expand All @@ -307,7 +280,7 @@ PUBLIC
include/stdexec/execution.hpp
include/stdexec/functional.hpp
include/stdexec/stop_token.hpp
include/tbbexec/tbb_thread_pool.hpp
# stdexec_version_config.hpp is generated by raipds' script
FILE_SET version_config
TYPE HEADERS
BASE_DIRS ${CMAKE_BINARY_DIR}/include
Expand Down Expand Up @@ -429,8 +402,41 @@ endif()

if(STDEXEC_ENABLE_CUDA)

file(GLOB_RECURSE nvexec_sources include/nvexec/*.cuh)
add_library(nvexec INTERFACE ${nvexec_sources})
add_library(nvexec INTERFACE)
target_sources(nvexec
PUBLIC
FILE_SET headers
TYPE HEADERS
BASE_DIRS include
FILES
include/nvexec/detail/config.cuh
include/nvexec/detail/cuda_atomic.cuh
include/nvexec/detail/cuda_fwd.cuh
include/nvexec/detail/memory.cuh
include/nvexec/detail/queue.cuh
include/nvexec/detail/throw_on_cuda_error.cuh
include/nvexec/detail/variant.cuh
include/nvexec/multi_gpu_context.cuh
include/nvexec/nvtx.cuh
include/nvexec/stream/algorithm_base.cuh
include/nvexec/stream/bulk.cuh
include/nvexec/stream/common.cuh
include/nvexec/stream/continues_on.cuh
include/nvexec/stream/ensure_started.cuh
include/nvexec/stream/launch.cuh
include/nvexec/stream/let_xxx.cuh
include/nvexec/stream/reduce.cuh
include/nvexec/stream/schedule_from.cuh
include/nvexec/stream/split.cuh
include/nvexec/stream/start_detached.cuh
include/nvexec/stream/submit.cuh
include/nvexec/stream/sync_wait.cuh
include/nvexec/stream/then.cuh
include/nvexec/stream/upon_error.cuh
include/nvexec/stream/upon_stopped.cuh
include/nvexec/stream/when_all.cuh
include/nvexec/stream_context.cuh
)
list(APPEND stdexec_export_targets nvexec)
add_library(STDEXEC::nvexec ALIAS nvexec)

Expand All @@ -442,6 +448,10 @@ if(STDEXEC_ENABLE_CUDA)
target_link_options(nvexec INTERFACE
$<$<AND:$<CXX_COMPILER_ID:NVHPC>,$<COMPILE_LANGUAGE:CXX>>:-stdpar -gpu=cc${CMAKE_CUDA_ARCHITECTURES}>)

install(TARGETS nvexec
EXPORT stdexec-exports
FILE_SET headers)

if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
include(rapids-cuda)
# Needs to run before `enable_language(CUDA)`
Expand Down Expand Up @@ -489,8 +499,15 @@ if (STDEXEC_ENABLE_TBB)
INSTALL_EXPORT_SET stdexec-exports
)

file(GLOB_RECURSE tbbexec_sources include/tbbexec/*.hpp)
add_library(tbbexec INTERFACE ${tbbexec_sources})
add_library(tbbexec INTERFACE)
target_sources(tbbexec
PUBLIC
FILE_SET headers
TYPE HEADERS
BASE_DIRS include
FILES
include/tbbexec/tbb_thread_pool.hpp
)
list(APPEND stdexec_export_targets tbbexec)
add_library(STDEXEC::tbbexec ALIAS tbbexec)

Expand All @@ -499,6 +516,10 @@ if (STDEXEC_ENABLE_TBB)
STDEXEC::stdexec
TBB::tbb
)

install(TARGETS tbbexec
EXPORT stdexec-exports
FILE_SET headers)
endif()

include(CheckIncludeFileCXX)
Expand Down

0 comments on commit dfb8e7d

Please sign in to comment.