From d32e75a84863664003cc4577e35efa3ecd9a2447 Mon Sep 17 00:00:00 2001 From: Emimendoza Date: Wed, 27 May 2026 14:36:42 -0400 Subject: [PATCH] [UR/offload] Change CUDA package to CUDAToolkit in CMakeLists.txt FindCUDA has been deprecated (CMP0146) Also the CUDAToolkit package defines CUDAToolkit_INCLUDE_DIRS, the CUDA package doesn't. This fixes a bug in which the UR offload adapter will fail to compile if the cuda adapter is not built alongside it since the cuda.h cannot be found (because CUDAToolkit_INCLUDE_DIRS is not set by the CUDA package) when compiling offload/program.cpp. UR_CUDA_ENABLED is still set because CUDA_cuda_driver_LIBRARY is still set by the CUDA package. --- unified-runtime/source/adapters/offload/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unified-runtime/source/adapters/offload/CMakeLists.txt b/unified-runtime/source/adapters/offload/CMakeLists.txt index a60b5ef78eb09..70223112ff55b 100644 --- a/unified-runtime/source/adapters/offload/CMakeLists.txt +++ b/unified-runtime/source/adapters/offload/CMakeLists.txt @@ -110,7 +110,7 @@ endif() # simply always link the incoming program so it ends up as CUBIN. Try to find # the cuda driver so we can enable this where possible. if (NOT TARGET cudadrv) - find_package(CUDA 10.1) + find_package(CUDAToolkit 10.1) add_library(cudadrv SHARED IMPORTED GLOBAL) set_target_properties( cudadrv PROPERTIES