-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the thrust dispatch mechanisms configurable #2310
Changes from all commits
a1ffe4b
2f242f4
096c5d4
6c2efe1
fc5fc24
8308963
e0c98be
2af243f
b28c913
2fdfb45
d3fae1f
551896e
22cbc0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,10 @@ option(THRUST_ENABLE_TESTING "Build Thrust testing suite." "ON") | |
option(THRUST_ENABLE_EXAMPLES "Build Thrust examples." "ON") | ||
option(THRUST_ENABLE_BENCHMARKS "Build Thrust runtime benchmarks." "${CCCL_ENABLE_BENCHMARKS}") | ||
|
||
# Allow the user to optionally select offset type dispatch to fixed 32 or 64 bit types | ||
set(THRUST_DISPATCH_TYPE "Dynamic" CACHE STRING "Select Thrust offset type dispatch." FORCE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This option is not visible to users consuming our CMake packages (e.g. CPM, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need this option to be usable when consuming CCCL from libcudf. That was the purpose of introducing this, in #1958. |
||
set_property(CACHE THRUST_DISPATCH_TYPE PROPERTY STRINGS "Dynamic" "Force32bit" "Force64bit") | ||
|
||
# Check if we're actually building anything before continuing. If not, no need | ||
# to search for deps, etc. This is a common approach for packagers that just | ||
# need the install rules. See GH issue NVIDIA/thrust#1211. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,19 @@ foreach(thrust_target IN LISTS THRUST_TARGETS) | |
"CUB_WRAPPED_NAMESPACE=wrapped_cub") | ||
thrust_add_header_test(${thrust_target} base "${header_definitions}") | ||
|
||
# We need to ensure that the different dispatch mechanisms work | ||
set(header_definitions | ||
"THRUST_WRAPPED_NAMESPACE=wrapped_thrust" | ||
"CUB_WRAPPED_NAMESPACE=wrapped_cub" | ||
"THRUST_FORCE_32_BIT_OFFSET_TYPE") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These header tests are linked to the interface targets built in |
||
thrust_add_header_test(${thrust_target} offset_32 "${header_definitions}") | ||
|
||
set(header_definitions | ||
"THRUST_WRAPPED_NAMESPACE=wrapped_thrust" | ||
"CUB_WRAPPED_NAMESPACE=wrapped_cub" | ||
"THRUST_FORCE_64_BIT_OFFSET_TYPE") | ||
thrust_add_header_test(${thrust_target} offset_64 "${header_definitions}") | ||
|
||
thrust_get_target_property(config_device ${thrust_target} DEVICE) | ||
if ("CUDA" STREQUAL "${config_device}") | ||
# Check that BF16 support can be disabled | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
FORCE
here means that a user can't override the value