Skip to content

Commit

Permalink
[ADAPTERS] update to latest from sycl
Browse files Browse the repository at this point in the history
  • Loading branch information
pbalcer committed Aug 2, 2023
1 parent 99ac337 commit 759e753
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if(UR_ENABLE_TRACING)
set(XPTI_DIR ${xpti_SOURCE_DIR})
set(XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests")

FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "sycl-nightly/20230304" "xptifw")
FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "sycl-nightly/20230703" "xptifw")

FetchContent_MakeAvailable(xptifw)

Expand Down
6 changes: 4 additions & 2 deletions source/adapters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

function(add_ur_adapter name)
add_library(${name} ${ARGN})
add_ur_library(${name} ${ARGN})
if(MSVC)
set(TARGET_LIBNAME ${name})
string(TOUPPER ${TARGET_LIBNAME} TARGET_LIBNAME)
Expand All @@ -15,6 +15,8 @@ function(add_ur_adapter name)
set_target_properties(${name} PROPERTIES
LINK_FLAGS "/DEF:${ADAPTER_VERSION_SCRIPT}"
)
elseif(APPLE)
target_compile_options(${name} PRIVATE "-fvisibility=hidden")
else()
set(TARGET_LIBNAME lib${name}_${PROJECT_VERSION_MAJOR}.0)
string(TOUPPER ${TARGET_LIBNAME} TARGET_LIBNAME)
Expand All @@ -31,7 +33,7 @@ add_subdirectory(null)
if(UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_HIP)
# fetch adapter sources from SYCL
set(SYCL_ADAPTER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external")
FetchSource(https://github.com/intel/llvm.git sycl-nightly/20230717 "sycl/plugins/unified_runtime/ur" ${SYCL_ADAPTER_DIR})
FetchSource(https://github.com/intel/llvm.git nightly-2023-08-01 "sycl/plugins/unified_runtime/ur" ${SYCL_ADAPTER_DIR})
endif()

if(UR_BUILD_ADAPTER_L0)
Expand Down
10 changes: 6 additions & 4 deletions source/adapters/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ set(TARGET_NAME ur_adapter_cuda)
add_ur_adapter(${TARGET_NAME}
SHARED
${CUDA_DIR}/ur_interface_loader.cpp
${CUDA_DIR}/adapter.hpp
${CUDA_DIR}/adapter.cpp
${CUDA_DIR}/command_buffer.hpp
${CUDA_DIR}/command_buffer.cpp
${CUDA_DIR}/common.hpp
${CUDA_DIR}/common.cpp
${CUDA_DIR}/context.hpp
Expand All @@ -33,12 +37,9 @@ add_ur_adapter(${TARGET_NAME}
${CUDA_DIR}/sampler.cpp
${CUDA_DIR}/tracing.cpp
${CUDA_DIR}/usm.cpp
${CUDA_DIR}/usm_p2p.cpp
${CUDA_DIR}/../../ur.cpp
${CUDA_DIR}/../../ur.hpp
${CUDA_DIR}/../../usm_allocator.cpp
${CUDA_DIR}/../../usm_allocator.hpp
${CUDA_DIR}/../../usm_allocator_config.cpp
${CUDA_DIR}/../../usm_allocator_config.hpp
)

set_target_properties(${TARGET_NAME} PROPERTIES
Expand Down Expand Up @@ -69,6 +70,7 @@ endif()
target_link_libraries(${TARGET_NAME} PRIVATE
${PROJECT_NAME}::headers
${PROJECT_NAME}::common
${PROJECT_NAME}::unified_malloc_framework
Threads::Threads
cudadrv
)
Expand Down
10 changes: 6 additions & 4 deletions source/adapters/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ set(HIP_HEADERS "${UR_HIP_INCLUDE_DIR};${UR_HIP_HSA_INCLUDE_DIR}")
add_ur_adapter(${TARGET_NAME}
SHARED
${HIP_DIR}/ur_interface_loader.cpp
${HIP_DIR}/adapter.hpp
${HIP_DIR}/adapter.cpp
${HIP_DIR}/command_buffer.hpp
${HIP_DIR}/command_buffer.cpp
${HIP_DIR}/common.hpp
${HIP_DIR}/common.cpp
${HIP_DIR}/context.hpp
Expand All @@ -67,12 +71,9 @@ add_ur_adapter(${TARGET_NAME}
${HIP_DIR}/sampler.hpp
${HIP_DIR}/sampler.cpp
${HIP_DIR}/usm.cpp
${HIP_DIR}/usm_p2p.cpp
${HIP_DIR}/../../ur.cpp
${HIP_DIR}/../../ur.hpp
${HIP_DIR}/../../usm_allocator.cpp
${HIP_DIR}/../../usm_allocator.hpp
${HIP_DIR}/../../usm_allocator_config.cpp
${HIP_DIR}/../../usm_allocator_config.hpp
)

if(NOT MSVC)
Expand Down Expand Up @@ -100,6 +101,7 @@ if("${UR_HIP_PLATFORM}" STREQUAL "AMD")
target_link_libraries(${TARGET_NAME} PRIVATE
${PROJECT_NAME}::headers
${PROJECT_NAME}::common
${PROJECT_NAME}::unified_malloc_framework
rocmdrv
)

Expand Down
10 changes: 6 additions & 4 deletions source/adapters/level_zero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ target_include_directories(LevelZeroLoader-Headers
add_ur_adapter(${TARGET_NAME}
SHARED
${L0_DIR}/ur_interface_loader.cpp
${L0_DIR}/adapter.hpp
${L0_DIR}/adapter.cpp
${L0_DIR}/command_buffer.hpp
${L0_DIR}/command_buffer.cpp
${L0_DIR}/common.hpp
${L0_DIR}/context.hpp
${L0_DIR}/device.hpp
Expand All @@ -91,17 +95,14 @@ add_ur_adapter(${TARGET_NAME}
${L0_DIR}/device.cpp
${L0_DIR}/event.cpp
${L0_DIR}/usm.cpp
${L0_DIR}/usm_p2p.cpp
${L0_DIR}/memory.cpp
${L0_DIR}/kernel.cpp
${L0_DIR}/platform.cpp
${L0_DIR}/program.cpp
${L0_DIR}/queue.cpp
${L0_DIR}/sampler.cpp
${L0_DIR}/../../ur.cpp
${L0_DIR}/../../usm_allocator.cpp
${L0_DIR}/../../usm_allocator.hpp
${L0_DIR}/../../usm_allocator_config.cpp
${L0_DIR}/../../usm_allocator_config.hpp
)

set_target_properties(${TARGET_NAME} PROPERTIES
Expand All @@ -112,6 +113,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES
target_link_libraries(${TARGET_NAME} PRIVATE
${PROJECT_NAME}::headers
${PROJECT_NAME}::common
${PROJECT_NAME}::unified_malloc_framework
LevelZeroLoader
LevelZeroLoader-Headers
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extern "C" {

static thread_local umf_memory_provider_handle_t lastFailedProvider = nullptr;

umf_memory_provider_handle_t *umfGetLastFailedMemoryProviderPtr() {
umf_memory_provider_handle_t *umfGetLastFailedMemoryProviderPtr(void) {
return &lastFailedProvider;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern "C" {
#endif

void *umfMemoryProviderGetPriv(umf_memory_provider_handle_t hProvider);
umf_memory_provider_handle_t *umfGetLastFailedMemoryProviderPtr();
umf_memory_provider_handle_t *umfGetLastFailedMemoryProviderPtr(void);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 759e753

Please sign in to comment.