Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 5 additions & 34 deletions sycl/plugins/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,51 +84,24 @@ endif()
# Set includes used in added library (rocmdrv)
set(HIP_HEADERS "${PI_HIP_INCLUDE_DIR};${PI_HIP_HSA_INCLUDE_DIR}")

# Get the HIP sources so they can be shared with HIP PI plugin
get_target_property(UR_HIP_ADAPTER_SOURCES ur_adapter_hip SOURCES)

# Create pi_hip library
add_sycl_plugin(hip
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/hip/adapter.cpp"
"../unified_runtime/ur/adapters/hip/adapter.hpp"
"../unified_runtime/ur/adapters/hip/command_buffer.cpp"
"../unified_runtime/ur/adapters/hip/command_buffer.hpp"
"../unified_runtime/ur/adapters/hip/common.cpp"
"../unified_runtime/ur/adapters/hip/common.hpp"
"../unified_runtime/ur/adapters/hip/context.cpp"
"../unified_runtime/ur/adapters/hip/context.hpp"
"../unified_runtime/ur/adapters/hip/device.cpp"
"../unified_runtime/ur/adapters/hip/device.hpp"
"../unified_runtime/ur/adapters/hip/enqueue.cpp"
"../unified_runtime/ur/adapters/hip/event.cpp"
"../unified_runtime/ur/adapters/hip/event.hpp"
"../unified_runtime/ur/adapters/hip/image.cpp"
"../unified_runtime/ur/adapters/hip/kernel.cpp"
"../unified_runtime/ur/adapters/hip/kernel.hpp"
"../unified_runtime/ur/adapters/hip/memory.cpp"
"../unified_runtime/ur/adapters/hip/memory.hpp"
"../unified_runtime/ur/adapters/hip/platform.cpp"
"../unified_runtime/ur/adapters/hip/platform.hpp"
"../unified_runtime/ur/adapters/hip/program.cpp"
"../unified_runtime/ur/adapters/hip/program.hpp"
"../unified_runtime/ur/adapters/hip/queue.cpp"
"../unified_runtime/ur/adapters/hip/queue.hpp"
"../unified_runtime/ur/adapters/hip/sampler.cpp"
"../unified_runtime/ur/adapters/hip/sampler.hpp"
"../unified_runtime/ur/adapters/hip/ur_interface_loader.cpp"
"../unified_runtime/ur/adapters/hip/usm.cpp"
"../unified_runtime/ur/adapters/hip/usm.hpp"
"../unified_runtime/ur/adapters/hip/usm_p2p.cpp"
${UR_HIP_ADAPTER_SOURCES}
"${sycl_inc_dir}/sycl/detail/pi.h"
"${sycl_inc_dir}/sycl/detail/pi.hpp"
"pi_hip.hpp"
"pi_hip.cpp"
INCLUDE_DIRS
${sycl_plugin_dir}
${CMAKE_CURRENT_SOURCE_DIR}/../unified_runtime
${UNIFIED_RUNTIME_SOURCE_DIR}/source/ # for adapters/hip
LIBRARIES
UnifiedRuntime-Headers
UnifiedRuntimeCommon
Expand All @@ -139,8 +112,6 @@ add_sycl_plugin(hip
set_target_properties(pi_hip PROPERTIES LINKER_LANGUAGE CXX)

if("${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD")
# Import HIP runtime library
add_library(rocmdrv SHARED IMPORTED GLOBAL)

set_target_properties(
rocmdrv PROPERTIES
Expand Down
20 changes: 10 additions & 10 deletions sycl/plugins/hip/pi_hip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@
#include <string>
#include <vector>

#include <ur/adapters/hip/command_buffer.hpp>
#include <ur/adapters/hip/context.hpp>
#include <ur/adapters/hip/device.hpp>
#include <ur/adapters/hip/event.hpp>
#include <ur/adapters/hip/kernel.hpp>
#include <ur/adapters/hip/memory.hpp>
#include <ur/adapters/hip/platform.hpp>
#include <ur/adapters/hip/program.hpp>
#include <ur/adapters/hip/queue.hpp>
#include <ur/adapters/hip/sampler.hpp>
#include <adapters/hip/command_buffer.hpp>
#include <adapters/hip/context.hpp>
#include <adapters/hip/device.hpp>
#include <adapters/hip/event.hpp>
#include <adapters/hip/kernel.hpp>
#include <adapters/hip/memory.hpp>
#include <adapters/hip/platform.hpp>
#include <adapters/hip/program.hpp>
#include <adapters/hip/queue.hpp>
#include <adapters/hip/sampler.hpp>

#include "pi2ur.hpp"

Expand Down
77 changes: 7 additions & 70 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ if (NOT DEFINED UNIFIED_RUNTIME_LIBRARY OR NOT DEFINED UNIFIED_RUNTIME_INCLUDE_D
include(FetchContent)

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
set(UNIFIED_RUNTIME_TAG b38855ed815ffd076bfde5e5e06170ca4f723dc1)
set(UNIFIED_RUNTIME_TAG e6343f4cca9a37b17bc63f3a81968ac3f486be8a)
Copy link
Contributor

@jsji jsji Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we want to rollback UR tag here?

* |   b38855e - (2023-10-05) Merge pull request #920 from jsji/localcopy - Piotr Balcer
|\ \
| * | 6a2c548 - (2023-10-02) [UR][L0] Copy prebuilt L0 to avoid leaking shared folder path - Jinsong Ji (localcopy)
|/ /
* |   e6343f4 - (2023-10-04) Merge pull request #923 from pbalcer/l0-win-fix-build - Piotr Balcer


set(UR_BUILD_ADAPTER_L0 ON)

if ("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
set(UR_BUILD_ADAPTER_CUDA ON)
endif()

if ("hip" IN_LIST SYCL_ENABLE_PLUGINS)
set(UR_BUILD_ADAPTER_HIP ON)
endif()
set(UMF_ENABLE_POOL_TRACKING ON)
message(STATUS "Will fetch Unified Runtime from ${UNIFIED_RUNTIME_REPO}")
FetchContent_Declare(unified-runtime
Expand Down Expand Up @@ -83,80 +86,14 @@ add_sycl_plugin(unified_runtime
)

add_dependencies(sycl-runtime-libraries ur_adapter_level_zero)
if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
add_dependencies(sycl-runtime-libraries ur_adapter_hip)
endif()

if ("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
add_dependencies(sycl-runtime-libraries ur_adapter_cuda)
endif()

if ("hip" IN_LIST SYCL_ENABLE_PLUGINS)
# Build HIP adapter
add_sycl_library("ur_adapter_hip" SHARED
SOURCES
"ur/ur.hpp"
"ur/ur.cpp"
"ur/adapters/hip/adapter.cpp"
"ur/adapters/hip/adapter.hpp"
"ur/adapters/hip/command_buffer.cpp"
"ur/adapters/hip/command_buffer.hpp"
"ur/adapters/hip/common.cpp"
"ur/adapters/hip/common.hpp"
"ur/adapters/hip/context.cpp"
"ur/adapters/hip/context.hpp"
"ur/adapters/hip/device.cpp"
"ur/adapters/hip/device.hpp"
"ur/adapters/hip/enqueue.cpp"
"ur/adapters/hip/event.cpp"
"ur/adapters/hip/event.hpp"
"ur/adapters/hip/image.cpp"
"ur/adapters/hip/kernel.cpp"
"ur/adapters/hip/kernel.hpp"
"ur/adapters/hip/memory.cpp"
"ur/adapters/hip/memory.hpp"
"ur/adapters/hip/platform.cpp"
"ur/adapters/hip/platform.hpp"
"ur/adapters/hip/program.cpp"
"ur/adapters/hip/program.hpp"
"ur/adapters/hip/queue.cpp"
"ur/adapters/hip/queue.hpp"
"ur/adapters/hip/sampler.cpp"
"ur/adapters/hip/sampler.hpp"
"ur/adapters/hip/ur_interface_loader.cpp"
"ur/adapters/hip/usm.cpp"
"ur/adapters/hip/usm.hpp"
"ur/adapters/hip/usm_p2p.cpp"
INCLUDE_DIRS
${sycl_inc_dir}
LIBRARIES
UnifiedRuntime-Headers
UnifiedRuntimeCommon
Threads::Threads
)

set_target_properties("ur_adapter_hip" PROPERTIES
VERSION "0.0.0"
SOVERSION "0"
)

if(UMF_ENABLE_POOL_TRACKING)
target_compile_definitions("ur_adapter_hip" PRIVATE
UMF_ENABLE_POOL_TRACKING)
else()
message(WARNING "HIP adapter USM pools are disabled, set UMF_ENABLE_POOL_TRACKING to enable them")
endif()

if("${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD")
target_link_libraries(ur_adapter_hip PUBLIC rocmdrv)
# Set HIP define to select AMD platform
target_compile_definitions(ur_adapter_hip PRIVATE __HIP_PLATFORM_AMD__)
elseif("${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "NVIDIA")
target_link_libraries(ur_adapter_hip PUBLIC cudadrv cudart)
# Set HIP define to select NVIDIA platform
target_compile_definitions(ur_adapter_hip PRIVATE __HIP_PLATFORM_NVIDIA__)
else()
message(FATAL_ERROR "Unspecified PI HIP platform please set SYCL_BUILD_PI_HIP_PLATFORM to 'AMD' or 'NVIDIA'")
endif()
endif()

if("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
add_sycl_library("ur_adapter_native_cpu" SHARED
SOURCES
Expand Down
7 changes: 7 additions & 0 deletions sycl/plugins/unified_runtime/ur/adapters/hip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# HIP adapter
The source for the HIP 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).
78 changes: 0 additions & 78 deletions sycl/plugins/unified_runtime/ur/adapters/hip/adapter.cpp

This file was deleted.

11 changes: 0 additions & 11 deletions sycl/plugins/unified_runtime/ur/adapters/hip/adapter.hpp

This file was deleted.

Loading