Skip to content

WIP: update CUDA support#769

Open
white238 wants to merge 1 commit into
developfrom
task/white238/cuda_update
Open

WIP: update CUDA support#769
white238 wants to merge 1 commit into
developfrom
task/white238/cuda_update

Conversation

@white238

@white238 white238 commented Jul 14, 2026

Copy link
Copy Markdown
Member

This updates BLT's CUDA support from the deprecated FindCUDA path to CMake's
built-in CUDA language and CUDAToolkit support.

Changes

  • Replace FindCUDA with native CUDA language enablement and find_package(CUDAToolkit REQUIRED).
  • Map the BLT CUDA runtime target to CMake's CUDA::cudart target.
  • Define blt::cuda_runtime as depending on CUDA::cudart, and blt::cuda as depending on cuda_runtime, matching the HIP target mapping style.
  • Remove Clang CUDA support, including ENABLE_CLANG_CUDA, BLT_CLANG_CUDA_ARCH, related setup/config propagation, and the dedicated cuda-arch test project.
  • Remove legacy CUDA link-rule overrides that were needed for FindCUDA, including custom CMAKE_CUDA_LINK_EXECUTABLE/device-link rules and CUDA rpath flag overrides.
  • Use CUDAToolkit_ROOT as the CUDA toolkit root variable. CUDA_TOOLKIT_ROOT_DIR is only read as a compatibility input and mapped to CUDAToolkit_ROOT.
  • Move separable compilation support to native CMake behavior via CMAKE_CUDA_SEPARABLE_COMPILATION. The old CUDA_SEPARABLE_COMPILATION variable is only mapped for compatibility.
  • Update CUDA host-config examples and tutorial text for CUDAToolkit_ROOT and native CMake CUDA support.
  • Fix CUDA/MPI test compatibility with hwloc 2.x. The build exposed an error where HWLOC_TOPOLOGY_FLAG_WHOLE_IO was undefined; the test now uses hwloc_topology_set_io_types_filter(..., HWLOC_TYPE_FILTER_KEEP_ALL) for hwloc 2.x and keeps HWLOC_TOPOLOGY_FLAG_WHOLE_IO for older hwloc versions.
  • Fix a Clang CUDA warning in the CUDA/MPI test caused by a variable-length array:
    cudaStream_t cuStreams[cudaStreams]
    The test now uses a single cudaStream_t for the local rank and destroys it during cleanup.
  • Update CUDA documentation after reviewing docs/tutorial/common_hpc_dependencies.rst and the rest of docs/. The tutorial now describes blt::cuda as compiling sources as CUDA language sources, and blt::cuda_runtime as adding CUDA runtime usage without changing source language. Removed stale CUDA_LINK_WITH_NVCC documentation and updated object-library CUDA device-link wording for native CMake CUDA behavior.
  • Add internal CUDA compile coverage for the migrated target behavior: t_cuda_runtime_compile verifies blt::cuda_runtime provides CUDA runtime headers/libraries without compiling the source as CUDA, and t_cuda_language_compile verifies blt::cuda changes a .cpp source to CUDA language compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant