-
Notifications
You must be signed in to change notification settings - Fork 23
Add --target-cuda
argument for selecting CUDA architecture
#2478
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
Changes from all commits
b6ed7f6
25bf7b9
b0bd17c
e0dae0e
c670477
dbdd077
b08c0e5
117f6a5
2a03eba
39b62e2
b335fa4
3cbcb31
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 | ||||
---|---|---|---|---|---|---|
|
@@ -68,14 +68,17 @@ find_package(Dpctl REQUIRED) | |||||
message(STATUS "Dpctl_INCLUDE_DIR=" ${Dpctl_INCLUDE_DIR}) | ||||||
message(STATUS "Dpctl_TENSOR_INCLUDE_DIR=" ${Dpctl_TENSOR_INCLUDE_DIR}) | ||||||
|
||||||
option(DPNP_TARGET_CUDA | ||||||
"Build DPNP to target CUDA devices" | ||||||
OFF | ||||||
) | ||||||
option(DPNP_USE_ONEMKL_INTERFACES | ||||||
"Build DPNP with oneMKL Interfaces" | ||||||
OFF | ||||||
) | ||||||
set(DPNP_TARGET_CUDA | ||||||
"" | ||||||
CACHE STRING | ||||||
"Build DPNP to target CUDA device. \ | ||||||
Set to a truthy value (e.g., ON, TRUE) to use default architecture (sm_50), \ | ||||||
or to a specific architecture like sm_80." | ||||||
) | ||||||
set(HIP_TARGETS "" CACHE STRING "HIP architecture for target") | ||||||
|
||||||
set(_dpnp_sycl_targets) | ||||||
|
@@ -87,8 +90,19 @@ set(_dpnp_sycl_target_compile_options) | |||||
set(_dpnp_sycl_target_link_options) | ||||||
|
||||||
if ("x${DPNP_SYCL_TARGETS}" STREQUAL "x") | ||||||
if(DPNP_TARGET_CUDA) | ||||||
set(_dpnp_sycl_targets "nvptx64-nvidia-cuda,spir64-unknown-unknown") | ||||||
if (DPNP_TARGET_CUDA) | ||||||
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. It is not
Suggested change
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. The empty string is False for this check 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.
That is not the case when 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. You are right that 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. Yes, it sounds reasonable. 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. @antonwolfy it will be updated in the next PR. |
||||||
set(_dpnp_cuda_arch) | ||||||
if(DPNP_TARGET_CUDA MATCHES "^sm_") | ||||||
set(_dpnp_cuda_arch ${DPNP_TARGET_CUDA}) | ||||||
elseif(DPNP_TARGET_CUDA MATCHES "^(ON|TRUE|YES|Y|1)$") | ||||||
set(_dpnp_cuda_arch "sm_50") | ||||||
else() | ||||||
message(FATAL_ERROR | ||||||
"Invalid value for DPNP_TARGET_CUDA: \"${DPNP_TARGET_CUDA}\". " | ||||||
"Expected 'ON', 'TRUE', 'YES', 'Y', '1', or a CUDA architecture like 'sm_80'." | ||||||
) | ||||||
endif() | ||||||
set(_dpnp_sycl_targets "nvidia_gpu_${_dpnp_cuda_arch},spir64-unknown-unknown") | ||||||
set(_use_onemkl_interfaces_cuda ON) | ||||||
endif() | ||||||
|
||||||
|
@@ -104,7 +118,7 @@ if ("x${DPNP_SYCL_TARGETS}" STREQUAL "x") | |||||
else() | ||||||
set(_dpnp_sycl_targets ${DPNP_SYCL_TARGETS}) | ||||||
|
||||||
if ("${DPNP_SYCL_TARGETS}" MATCHES "nvptx64-nvidia-cuda") | ||||||
if("${DPNP_SYCL_TARGETS}" MATCHES "(nvidia_gpu_sm_|nvptx64-nvidia-cuda)") | ||||||
set(_use_onemkl_interfaces_cuda ON) | ||||||
endif() | ||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.