Skip to content

Commit 8d9a58a

Browse files
committed
Merge branch 'llvm' into review/yang/dsan_nullpointer
2 parents 345e012 + 2184e80 commit 8d9a58a

40 files changed

+1382
-846
lines changed

.github/workflows/benchmarks_compute.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ jobs:
143143
--ci-defaults ${{matrix.adapter.sycl_config}}
144144
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
145145
--cmake-opt="-DSYCL_PI_TESTS=OFF"
146-
--cmake-opt="-DSYCL_PI_UR_USE_FETCH_CONTENT=OFF"
147-
--cmake-opt="-DSYCL_PI_UR_SOURCE_DIR=${{github.workspace}}/ur-repo/"
146+
--cmake-opt="-DSYCL_UR_USE_FETCH_CONTENT=OFF"
147+
--cmake-opt="-DSYCL_UR_SOURCE_DIR=${{github.workspace}}/ur-repo/"
148148
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
149149
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
150150

.github/workflows/e2e_core.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ jobs:
130130
--ci-defaults ${{matrix.adapter.config}}
131131
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
132132
--cmake-opt="-DSYCL_PI_TESTS=OFF"
133-
--cmake-opt="-DSYCL_PI_UR_USE_FETCH_CONTENT=OFF"
134-
--cmake-opt="-DSYCL_PI_UR_SOURCE_DIR=${{github.workspace}}/ur-repo/"
133+
--cmake-opt="-DSYCL_UR_USE_FETCH_CONTENT=OFF"
134+
--cmake-opt="-DSYCL_UR_SOURCE_DIR=${{github.workspace}}/ur-repo/"
135135
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
136136
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
137137
@@ -157,7 +157,7 @@ jobs:
157157
- name: Setup SYCL variables
158158
run: |
159159
which clang++ sycl-ls
160-
SYCL_PI_TRACE=-1 sycl-ls
160+
SYCL_UR_TRACE=-1 sycl-ls
161161
162162
- name: Build e2e tests
163163
run: >

.github/workflows/e2e_level_zero.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
config: ""
2222
unit: "gpu"
2323
# Failing tests
24-
xfail: "Config/select_device.cpp;DeviceCodeSplit/grf.cpp;ESIMD/grf.cpp;KernelAndProgram/target_register_alloc_mode.cpp;Matrix/SG32/get_coord_int8_matB.cpp;Matrix/get_coord_int8_matB.cpp;Matrix/joint_matrix_prefetch.cpp;Matrix/joint_matrix_rowmajorA_rowmajorB.cpp;Plugin/level_zero_barrier_optimization.cpp"
24+
xfail: "DeviceCodeSplit/grf.cpp;ESIMD/grf.cpp;ESIMD/mask_expand_load.cpp;KernelAndProgram/target_register_alloc_mode.cpp;Matrix/SG32/get_coord_int8_matB.cpp;Matrix/get_coord_int8_matB.cpp;Matrix/joint_matrix_prefetch.cpp;Matrix/joint_matrix_rowmajorA_rowmajorB.cpp; SYCL :: ESIMD/mask_expand_load.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_bf16_fill_k_cache_OOB.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_out_bounds.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_prefetch.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_rowmajorA_rowmajorB.cpp;Matrix/element_wise_all_ops_1d.cpp;Matrix/element_wise_all_ops_1d_cont.cpp;Matrix/element_wise_all_ops_scalar.cpp;Matrix/joint_matrix_bf16_fill_k_cache_OOB.cpp;Matrix/joint_matrix_bf16_fill_k_cache_prefetch.cpp;Matrix/joint_matrix_out_bounds.cpp;Matrix/joint_matrix_unaligned_k.cpp"
2525
# Flaky tests
26-
filter_out: "ESIMD/named_barriers/loop_extended.cpp"
26+
filter_out: "ESIMD/named_barriers/loop_extended.cpp;ESIMD/local_accessor_copy_to_from.cpp;"
2727
# These runners by default spawn upwards of 260 workers.
2828
# We also add a time out just in case some test hangs
2929
extra_lit_flags: "--param gpu-intel-pvc=True --param gpu-intel-pvc-1T=True -sv -j 100 --max-time=3600"

source/adapters/level_zero/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,15 @@ if(UR_BUILD_ADAPTER_L0_V2)
179179
${CMAKE_CURRENT_SOURCE_DIR}/common.hpp
180180
${CMAKE_CURRENT_SOURCE_DIR}/device.hpp
181181
${CMAKE_CURRENT_SOURCE_DIR}/platform.hpp
182+
${CMAKE_CURRENT_SOURCE_DIR}/program.hpp
183+
${CMAKE_CURRENT_SOURCE_DIR}/helpers/kernel_helpers.hpp
182184
${CMAKE_CURRENT_SOURCE_DIR}/adapter.cpp
183185
${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
184186
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
185187
${CMAKE_CURRENT_SOURCE_DIR}/ur_interface_loader.cpp
186188
${CMAKE_CURRENT_SOURCE_DIR}/platform.cpp
189+
${CMAKE_CURRENT_SOURCE_DIR}/program.cpp
190+
${CMAKE_CURRENT_SOURCE_DIR}/helpers/kernel_helpers.cpp
187191
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
188192
# v2-only sources
189193
${CMAKE_CURRENT_SOURCE_DIR}/v2/command_list_cache.hpp
@@ -194,8 +198,10 @@ if(UR_BUILD_ADAPTER_L0_V2)
194198
${CMAKE_CURRENT_SOURCE_DIR}/v2/event_provider_normal.hpp
195199
${CMAKE_CURRENT_SOURCE_DIR}/v2/event_provider.hpp
196200
${CMAKE_CURRENT_SOURCE_DIR}/v2/event.hpp
201+
${CMAKE_CURRENT_SOURCE_DIR}/v2/kernel.hpp
197202
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_api.hpp
198203
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_immediate_in_order.hpp
204+
${CMAKE_CURRENT_SOURCE_DIR}/v2/usm.hpp
199205
${CMAKE_CURRENT_SOURCE_DIR}/v2/api.cpp
200206
${CMAKE_CURRENT_SOURCE_DIR}/v2/command_list_cache.cpp
201207
${CMAKE_CURRENT_SOURCE_DIR}/v2/context.cpp
@@ -204,9 +210,11 @@ if(UR_BUILD_ADAPTER_L0_V2)
204210
${CMAKE_CURRENT_SOURCE_DIR}/v2/event_provider_counter.cpp
205211
${CMAKE_CURRENT_SOURCE_DIR}/v2/event_provider_normal.cpp
206212
${CMAKE_CURRENT_SOURCE_DIR}/v2/event.cpp
213+
${CMAKE_CURRENT_SOURCE_DIR}/v2/kernel.cpp
207214
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_api.cpp
208215
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_create.cpp
209216
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_immediate_in_order.cpp
217+
${CMAKE_CURRENT_SOURCE_DIR}/v2/usm.cpp
210218
)
211219

212220
if(NOT WIN32)
@@ -220,6 +228,8 @@ if(UR_BUILD_ADAPTER_L0_V2)
220228
)
221229
endif()
222230

231+
target_compile_definitions(ur_adapter_level_zero_v2 PUBLIC UR_ADAPTER_LEVEL_ZERO_V2)
232+
223233
# TODO: fix level_zero adapter conversion warnings
224234
target_compile_options(ur_adapter_level_zero_v2 PRIVATE
225235
$<$<CXX_COMPILER_ID:MSVC>:/wd4805 /wd4244>
@@ -245,6 +255,7 @@ if(UR_BUILD_ADAPTER_L0_V2)
245255

246256
target_include_directories(ur_adapter_level_zero_v2 PRIVATE
247257
"${CMAKE_CURRENT_SOURCE_DIR}/../.."
258+
"${CMAKE_CURRENT_SOURCE_DIR}/../../ur"
248259
LevelZeroLoader-Headers
249260
)
250261
endif()

source/adapters/level_zero/command_buffer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "common.hpp"
1818

1919
#include "context.hpp"
20+
#include "kernel.hpp"
2021
#include "queue.hpp"
2122

2223
struct command_buffer_profiling_t {

source/adapters/level_zero/common.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#include <umf_pools/disjoint_pool_config_parser.hpp>
2727

28+
#include "logger/ur_logger.hpp"
29+
2830
struct _ur_platform_handle_t;
2931

3032
static auto getUrResultString = [](ur_result_t Result) {
@@ -168,7 +170,7 @@ static auto getUrResultString = [](ur_result_t Result) {
168170
}
169171
};
170172

171-
// Trace an internal PI call; returns in case of an error.
173+
// Trace an internal UR call; returns in case of an error.
172174
#define UR_CALL(Call) \
173175
{ \
174176
if (PrintTrace) \
@@ -180,6 +182,18 @@ static auto getUrResultString = [](ur_result_t Result) {
180182
return Result; \
181183
}
182184

185+
// Trace an internal UR call; throw in case of an error.
186+
#define UR_CALL_THROWS(Call) \
187+
{ \
188+
if (PrintTrace) \
189+
logger::always("UR ---> {}", #Call); \
190+
ur_result_t Result = (Call); \
191+
if (PrintTrace) \
192+
logger::always("UR <--- {}({})", #Call, getUrResultString(Result)); \
193+
if (Result != UR_RESULT_SUCCESS) \
194+
throw Result; \
195+
}
196+
183197
// Controls UR L0 calls tracing.
184198
enum UrDebugLevel {
185199
UR_L0_DEBUG_NONE = 0x0,

source/adapters/level_zero/context.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,3 +829,12 @@ bool ur_context_handle_t_::isValidDevice(ur_device_handle_t Device) const {
829829
}
830830
return false;
831831
}
832+
833+
const std::vector<ur_device_handle_t> &
834+
ur_context_handle_t_::getDevices() const {
835+
return Devices;
836+
}
837+
838+
ze_context_handle_t ur_context_handle_t_::getZeHandle() const {
839+
return ZeContext;
840+
}

source/adapters/level_zero/context.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ struct ur_context_handle_t_ : _ur_object {
193193
// Return the Platform, which is the same for all devices in the context
194194
ur_platform_handle_t getPlatform() const;
195195

196+
// Get vector of devices from this context
197+
const std::vector<ur_device_handle_t> &getDevices() const;
198+
196199
// Get index of the free slot in the available pool. If there is no available
197200
// pool then create new one. The HostVisible parameter tells if we need a
198201
// slot for a host-visible event. The ProfilingEnabled tells is we need a
@@ -303,6 +306,9 @@ struct ur_context_handle_t_ : _ur_object {
303306
// For that the Device or its root devices need to be in the context.
304307
bool isValidDevice(ur_device_handle_t Device) const;
305308

309+
// Get handle to the L0 context
310+
ze_context_handle_t getZeHandle() const;
311+
306312
private:
307313
// Get the cache of events for a provided scope and profiling mode.
308314
auto getEventCache(bool HostVisible, bool WithProfiling,

source/adapters/level_zero/helpers/kernel_helpers.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
#include "logger/ur_logger.hpp"
1313

1414
#include "../common.hpp"
15-
#include "../context.hpp"
1615
#include "../device.hpp"
1716

17+
#ifdef UR_ADAPTER_LEVEL_ZERO_V2
18+
#include "../context.hpp"
19+
#else
20+
#include "../v2/context.hpp"
21+
#endif
22+
1823
ur_result_t getSuggestedLocalWorkSize(ur_device_handle_t hDevice,
1924
ze_kernel_handle_t hZeKernel,
2025
size_t GlobalWorkSize3D[3],

source/adapters/level_zero/platform.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ ur_result_t ur_platform_handle_t_::populateDeviceCacheIfNeeded() {
503503
return UR_RESULT_SUCCESS;
504504
}
505505

506+
size_t ur_platform_handle_t_::getNumDevices() { return URDevicesCache.size(); }
507+
506508
ur_device_handle_t ur_platform_handle_t_::getDeviceById(DeviceId id) {
507509
for (auto &dev : URDevicesCache) {
508510
if (dev->Id == id) {

0 commit comments

Comments
 (0)