Skip to content

Commit 1f22b27

Browse files
author
Hugh Delaney
authored
Merge branch 'main' into try-catch
2 parents d1f490d + 0c60db6 commit 1f22b27

File tree

123 files changed

+3569
-1637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+3569
-1637
lines changed

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ loader:
3131
opencl:
3232
- changed-files:
3333
- any-glob-to-any-file:
34-
- source/adapter/opencl/**
34+
- source/adapters/opencl/**
3535

3636
level-zero:
3737
- changed-files:

.github/workflows/build-fuzz-reusable.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ jobs:
4141
4242
- name: Build level zero with gcc
4343
run: |
44-
git clone -b v1.17.6 --depth=1 https://github.com/oneapi-src/level-zero.git ${{github.workspace}}/level-zero
44+
git clone -b v1.18.5 --depth=1 https://github.com/oneapi-src/level-zero.git ${{github.workspace}}/level-zero
4545
cd ${{github.workspace}}/level-zero
4646
cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
4747
cmake --build build -j $(nproc)
4848
4949
- name: Configure CMake
50-
# CFI sanitization (or flto?) seems to cause linking to fail
51-
# https://github.com/oneapi-src/unified-runtime/issues/2323
5250
run: >
5351
cmake
5452
-B${{github.workspace}}/build
@@ -60,7 +58,6 @@ jobs:
6058
-DUR_USE_ASAN=ON
6159
-DUR_USE_UBSAN=ON
6260
-DUR_BUILD_ADAPTER_L0=ON
63-
-DUR_USE_CFI=OFF
6461
-DUR_LEVEL_ZERO_LOADER_LIBRARY=${{github.workspace}}/level-zero/build/lib/libze_loader.so
6562
-DUR_LEVEL_ZERO_INCLUDE_DIR=${{github.workspace}}/level-zero/include/
6663
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++

.github/workflows/build-hw-reusable.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ jobs:
8282
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
8383
8484
- name: Configure CMake
85-
# CFI sanitization seems to fail on our CUDA nodes
86-
# https://github.com/oneapi-src/unified-runtime/issues/2309
8785
run: >
8886
cmake
8987
-B${{github.workspace}}/build
@@ -96,7 +94,6 @@ jobs:
9694
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
9795
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
9896
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
99-
-DUR_USE_CFI=${{ matrix.adapter.name == 'CUDA' && 'OFF' || 'ON' }}
10097
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
10198
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
10299
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++

.github/workflows/cmake.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,12 @@ jobs:
256256
compiler: {c: clang-cl, cxx: clang-cl}
257257

258258
build_type: [Debug, Release]
259-
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
259+
# TODO: clang-cl seems to be fully broken (https://github.com/oneapi-src/unified-runtime/issues/2348)
260+
#compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
261+
compiler: [{c: cl, cxx: cl}]
260262
include:
261-
- compiler: {c: clang-cl, cxx: clang-cl}
262-
toolset: "-T ClangCL"
263+
#- compiler: {c: clang-cl, cxx: clang-cl}
264+
# toolset: "-T ClangCL"
263265
- os: 'windows-2022'
264266
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'}
265267
build_type: 'Release'

.github/workflows/e2e_core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
191191
- name: Run e2e tests
192192
id: tests
193-
run: ninja -C build-e2e check-sycl-e2e
193+
run: ninja -C build-e2e check-sycl-e2e || echo "e2e tests have failed. Ignoring failure."
194194

195195
# FIXME: Requires pull-request: write permissions but this is only granted
196196
# on pull requests from forks if using pull_request_target workflow

CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ include(CheckCXXSourceCompiles)
1616
include(CMakePackageConfigHelpers)
1717
include(CTest)
1818

19-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
20-
include(helpers)
21-
22-
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
23-
set(Python3_FIND_FRAMEWORK NEVER)
24-
set(Python3_FIND_STRATEGY LOCATION)
25-
endif()
26-
27-
find_package(Python3 COMPONENTS Interpreter REQUIRED)
28-
29-
set(CMAKE_CXX_STANDARD 17)
30-
set(CMAKE_CXX_STANDARD_REQUIRED YES)
31-
3219
# Build Options
3320
option(UR_BUILD_EXAMPLES "Build example applications." ON)
3421
option(UR_BUILD_TESTS "Build unit tests." ON)
@@ -81,6 +68,19 @@ set(UR_ADAPTER_HIP_SOURCE_DIR "" CACHE PATH
8168
set(UR_ADAPTER_NATIVE_CPU_SOURCE_DIR "" CACHE PATH
8269
"Path to external 'native_cpu' adapter source dir")
8370

71+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
72+
include(helpers)
73+
74+
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
75+
set(Python3_FIND_FRAMEWORK NEVER)
76+
set(Python3_FIND_STRATEGY LOCATION)
77+
endif()
78+
79+
find_package(Python3 COMPONENTS Interpreter REQUIRED)
80+
81+
set(CMAKE_CXX_STANDARD 17)
82+
set(CMAKE_CXX_STANDARD_REQUIRED YES)
83+
8484
# There's little reason not to generate the compile_commands.json
8585
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8686

cmake/FetchLevelZero.cmake

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ set(UR_LEVEL_ZERO_LOADER_LIBRARY "" CACHE FILEPATH "Path of the Level Zero Loade
77
set(UR_LEVEL_ZERO_INCLUDE_DIR "" CACHE FILEPATH "Directory containing the Level Zero Headers")
88
set(UR_LEVEL_ZERO_LOADER_REPO "" CACHE STRING "Github repo to get the Level Zero loader sources from")
99
set(UR_LEVEL_ZERO_LOADER_TAG "" CACHE STRING " GIT tag of the Level Loader taken from github repo")
10+
set(UR_COMPUTE_RUNTIME_REPO "" CACHE STRING "Github repo to get the compute runtime sources from")
11+
set(UR_COMPUTE_RUNTIME_TAG "" CACHE STRING " GIT tag of the compute runtime taken from github repo")
1012

1113
# Copy Level Zero loader/headers locally to the build to avoid leaking their path.
1214
set(LEVEL_ZERO_COPY_DIR ${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader)
@@ -40,7 +42,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
4042
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
4143
endif()
4244
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "")
43-
set(UR_LEVEL_ZERO_LOADER_TAG v1.18.5)
45+
set(UR_LEVEL_ZERO_LOADER_TAG v1.19.2)
4446
endif()
4547

4648
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
@@ -87,8 +89,31 @@ target_link_libraries(LevelZeroLoader
8789
INTERFACE "${LEVEL_ZERO_LIB_NAME}"
8890
)
8991

92+
file(GLOB LEVEL_ZERO_LOADER_API_HEADERS "${LEVEL_ZERO_INCLUDE_DIR}/*.h")
93+
file(COPY ${LEVEL_ZERO_LOADER_API_HEADERS} DESTINATION ${LEVEL_ZERO_INCLUDE_DIR}/level_zero)
9094
add_library(LevelZeroLoader-Headers INTERFACE)
9195
target_include_directories(LevelZeroLoader-Headers
92-
INTERFACE "$<BUILD_INTERFACE:${LEVEL_ZERO_INCLUDE_DIR}>"
96+
INTERFACE "$<BUILD_INTERFACE:${LEVEL_ZERO_INCLUDE_DIR};${LEVEL_ZERO_INCLUDE_DIR}/level_zero>"
97+
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
98+
)
99+
100+
if (UR_COMPUTE_RUNTIME_REPO STREQUAL "")
101+
set(UR_COMPUTE_RUNTIME_REPO "https://github.com/intel/compute-runtime.git")
102+
endif()
103+
if (UR_COMPUTE_RUNTIME_TAG STREQUAL "")
104+
set(UR_COMPUTE_RUNTIME_TAG 24.39.31294.12)
105+
endif()
106+
include(FetchContent)
107+
# Sparse fetch only the dir with level zero headers to avoid pulling in the entire compute-runtime.
108+
FetchContentSparse_Declare(compute-runtime-level-zero-headers ${UR_COMPUTE_RUNTIME_REPO} "${UR_COMPUTE_RUNTIME_TAG}" "level_zero/include")
109+
FetchContent_GetProperties(compute-runtime-level-zero-headers)
110+
if(NOT compute-runtime-level-zero-headers_POPULATED)
111+
FetchContent_Populate(compute-runtime-level-zero-headers)
112+
endif()
113+
add_library(ComputeRuntimeLevelZero-Headers INTERFACE)
114+
set(COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE "${compute-runtime-level-zero-headers_SOURCE_DIR}/../..")
115+
message(STATUS "Level Zero Adapter: Using Level Zero headers from ${COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE}")
116+
target_include_directories(ComputeRuntimeLevelZero-Headers
117+
INTERFACE "$<BUILD_INTERFACE:${COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE}>"
93118
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
94119
)

cmake/helpers.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
6363
check_cxx_compiler_flag("-fstack-clash-protection" CXX_HAS_FSTACK_CLASH_PROTECTION)
6464
endif()
6565

66+
if (UR_USE_CFI AND UR_USE_ASAN)
67+
message(WARNING "Both UR_USE_CFI and UR_USE_ASAN are ON. "
68+
"Due to build errors, this is unsupported; CFI checks will be disabled")
69+
set(UR_USE_CFI OFF)
70+
endif()
71+
6672
if (UR_USE_CFI)
6773
set(SAVED_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
6874
set(CMAKE_REQUIRED_FLAGS "-flto -fvisibility=hidden")

include/ur_api.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,8 @@ typedef enum ur_device_info_t {
17051705
UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native
17061706
///< work
17071707
UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP = 0x2021, ///< [::ur_bool_t] returns true if the device supports low-power events.
1708+
UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP = 0x2022, ///< [::ur_exp_device_2d_block_array_capability_flags_t] return a bit-field
1709+
///< of Intel GPU 2D block array capabilities
17081710
/// @cond
17091711
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
17101712
/// @endcond
@@ -1730,7 +1732,7 @@ typedef enum ur_device_info_t {
17301732
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
17311733
/// + `NULL == hDevice`
17321734
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1733-
/// + `::UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP < propName`
1735+
/// + `::UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP < propName`
17341736
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
17351737
/// + If `propName` is not supported by the adapter.
17361738
/// - ::UR_RESULT_ERROR_INVALID_SIZE
@@ -7428,6 +7430,27 @@ urEnqueueWriteHostPipe(
74287430
///< an element of the phEventWaitList array.
74297431
);
74307432

7433+
#if !defined(__GNUC__)
7434+
#pragma endregion
7435+
#endif
7436+
// Intel 'oneAPI' Unified Runtime Experimental device descriptor for querying Intel device 2D block array capabilities
7437+
#if !defined(__GNUC__)
7438+
#pragma region 2d_block_array_capabilities_(experimental)
7439+
#endif
7440+
///////////////////////////////////////////////////////////////////////////////
7441+
/// @brief Intel GPU 2D block array capabilities
7442+
typedef uint32_t ur_exp_device_2d_block_array_capability_flags_t;
7443+
typedef enum ur_exp_device_2d_block_array_capability_flag_t {
7444+
UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_LOAD = UR_BIT(0), ///< Load instructions are supported
7445+
UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_STORE = UR_BIT(1), ///< Store instructions are supported
7446+
/// @cond
7447+
UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAG_FORCE_UINT32 = 0x7fffffff
7448+
/// @endcond
7449+
7450+
} ur_exp_device_2d_block_array_capability_flag_t;
7451+
/// @brief Bit Mask for validating ur_exp_device_2d_block_array_capability_flags_t
7452+
#define UR_EXP_DEVICE_2D_BLOCK_ARRAY_CAPABILITY_FLAGS_MASK 0xfffffffc
7453+
74317454
#if !defined(__GNUC__)
74327455
#pragma endregion
74337456
#endif

include/ur_print.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintMapFlags(enum ur_map_flag_t value, ch
874874
/// - `buff_size < out_size`
875875
UR_APIEXPORT ur_result_t UR_APICALL urPrintUsmMigrationFlags(enum ur_usm_migration_flag_t value, char *buffer, const size_t buff_size, size_t *out_size);
876876

877+
///////////////////////////////////////////////////////////////////////////////
878+
/// @brief Print ur_exp_device_2d_block_array_capability_flag_t enum
879+
/// @returns
880+
/// - ::UR_RESULT_SUCCESS
881+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
882+
/// - `buff_size < out_size`
883+
UR_APIEXPORT ur_result_t UR_APICALL urPrintExpDevice_2dBlockArrayCapabilityFlags(enum ur_exp_device_2d_block_array_capability_flag_t value, char *buffer, const size_t buff_size, size_t *out_size);
884+
877885
///////////////////////////////////////////////////////////////////////////////
878886
/// @brief Print ur_exp_image_copy_flag_t enum
879887
/// @returns

0 commit comments

Comments
 (0)