-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL][CUDA] Fetch the adapter source from the UR repo #11342
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
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 |
|---|---|---|
| @@ -1,29 +1,11 @@ | ||
| message(STATUS "Including the PI API CUDA backend.") | ||
|
|
||
| # cannot rely on cmake support for CUDA; it assumes runtime API is being used. | ||
| # we only require the CUDA driver API to be used | ||
| # CUDA_CUDA_LIBRARY variable defines the path to libcuda.so, the CUDA Driver API library. | ||
|
|
||
| find_package(CUDA 10.1 REQUIRED) | ||
|
|
||
| # Make imported library global to use it within the project. | ||
| add_library(cudadrv SHARED IMPORTED GLOBAL) | ||
|
|
||
| if (WIN32) | ||
| set_target_properties( | ||
| cudadrv PROPERTIES | ||
| IMPORTED_IMPLIB ${CUDA_CUDA_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${CUDA_INCLUDE_DIRS} | ||
| ) | ||
| else() | ||
| set_target_properties( | ||
| cudadrv PROPERTIES | ||
| IMPORTED_LOCATION ${CUDA_CUDA_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${CUDA_INCLUDE_DIRS} | ||
| ) | ||
| endif() | ||
|
|
||
| if (SYCL_ENABLE_XPTI_TRACING) | ||
| # cannot rely on cmake support for CUDA; it assumes runtime API is being used. | ||
| # we only require the CUDA driver API to be used | ||
| # CUDA_CUDA_LIBRARY variable defines the path to libcuda.so, the CUDA Driver API library. | ||
| find_package(CUDA 10.1 REQUIRED) | ||
|
||
|
|
||
| # The following two if's can be removed when FindCUDA -> FindCUDAToolkit. | ||
| # CUDA_CUPTI_INCLUDE_DIR -> CUDAToolkit_CUPTI_INCLUDE_DIR | ||
| include(FindCUDACupti) | ||
|
|
@@ -46,46 +28,15 @@ if (SYCL_ENABLE_XPTI_TRACING) | |
| ) | ||
| endif() | ||
|
|
||
| # Get the CUDA adapter sources so they can be shared with the CUDA PI plugin | ||
| get_target_property(UR_CUDA_ADAPTER_SOURCES ur_adapter_cuda SOURCES) | ||
|
|
||
| add_sycl_plugin(cuda | ||
| SOURCES | ||
| ${UR_CUDA_ADAPTER_SOURCES} | ||
| # Some code is shared with the UR adapter | ||
| "../unified_runtime/pi2ur.hpp" | ||
| "../unified_runtime/pi2ur.cpp" | ||
| "../unified_runtime/ur/ur.hpp" | ||
| "../unified_runtime/ur/ur.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/adapter.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/adapter.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/command_buffer.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/command_buffer.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/common.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/common.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/context.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/context.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/device.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/device.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/enqueue.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/event.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/event.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/image.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/image.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/kernel.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/kernel.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/memory.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/memory.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/platform.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/platform.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/program.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/program.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/queue.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/queue.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/sampler.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/sampler.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/tracing.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/ur_interface_loader.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/usm.cpp" | ||
| "../unified_runtime/ur/adapters/cuda/usm.hpp" | ||
| "../unified_runtime/ur/adapters/cuda/usm_p2p.cpp" | ||
| # --- | ||
| "${sycl_inc_dir}/sycl/detail/pi.h" | ||
| "${sycl_inc_dir}/sycl/detail/pi.hpp" | ||
| "pi_cuda.hpp" | ||
|
|
@@ -94,7 +45,8 @@ add_sycl_plugin(cuda | |
| INCLUDE_DIRS | ||
| ${sycl_inc_dir} | ||
| ${XPTI_INCLUDE} | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/../unified_runtime | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/../unified_runtime # for Unified Runtime | ||
| ${UNIFIED_RUNTIME_SOURCE_DIR}/source/ # for adapters/cuda | ||
| LIBRARIES | ||
| cudadrv | ||
| ${XPTI_LIBS} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Cuda adapter | ||
| The source for the Cuda adapter has been moved to the | ||
| [adapters](https://github.com/oneapi-src/unified-runtime/tree/adapters) branch | ||
| of the [Unified Runtime](https://github.com/oneapi-src/unified-runtime/) repo. | ||
| Changes can be made by opening pull requests against that branch, and updating | ||
| the Unified Runtime commit in the parent | ||
| [CMakeLists.txt](../../../CMakeLists.txt). |
This file was deleted.
This file was deleted.
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.
I'm not sure of the significance of this part, but should/have you checked whether the removal of this code affects windows builds?
Uh oh!
There was an error while loading. Please reload this page.
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.
Do we officially support windows builds in CUDA? CI doesn't seem to run it.
This code was moved to unified-runtime repo: https://github.com/oneapi-src/unified-runtime/blob/adapters/source/adapters/cuda/CMakeLists.txt
It was causing issues because cudadrv was being imported twice. I think the behaviour should stay the same after the move.
For what it is worth, the windows job passed with this changes: https://github.com/intel/llvm/actions/runs/6340282334
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.
Windows support is experimental for cuda backend but I don't think it is tested by any CI. You should be able to build and run most tests on it though. Would be good to just check if still builds if the CMake changes could affect it. Codeplay has a windows machine available for this. If you are sure it won't affect windows build then of course this won't be worthwhile.
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.
I think since the code is moved to UR, and linux CI cuda testing works, it is expected to still work on windows too.