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
5 changes: 0 additions & 5 deletions sycl/test-e2e/DeviceWait/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

// UNSUPPORTED: windows && run-mode && gpu-intel-gen12
// UNSUPPORTED-INTENDED: gen12 doesn't support aspect-ext_oneapi_device_wait.
// Adding UNSUPPORTED until UR does report lack of
// aspect-ext_oneapi_device_wait support on gen12.

#include <sycl/detail/core.hpp>
#include <sycl/properties/all_properties.hpp>

Expand Down
6 changes: 4 additions & 2 deletions unified-runtime/source/adapters/level_zero/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,8 +1325,10 @@ ur_result_t urDeviceGetInfo(
return ReturnValue(true);
case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP:
return ReturnValue(true);
case UR_DEVICE_INFO_DEVICE_WAIT_SUPPORT_EXP:
return ReturnValue(true);
case UR_DEVICE_INFO_DEVICE_WAIT_SUPPORT_EXP: {
auto Supported = Device->Platform->ZeDeviceSynchronizeSupported;
return ReturnValue(Supported);
}
case UR_DEVICE_INFO_DYNAMIC_LINK_SUPPORT_EXP:
return ReturnValue(true);
case UR_DEVICE_INFO_ASYNC_USM_ALLOCATIONS_SUPPORT_EXP:
Expand Down
10 changes: 10 additions & 0 deletions unified-runtime/source/adapters/level_zero/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,16 @@ ur_result_t ur_platform_handle_t_::populateDeviceCacheIfNeeded() {
dev->Id = id++;
}

// Check if platform supports device synchronization by calling
// zeDeviceSynchronize on the first device.
if (!URDevicesCache.empty()) {
auto ZeDevice = URDevicesCache[0]->ZeDevice;
auto ZeResult = ZE_CALL_NOCHECK(zeDeviceSynchronize, (ZeDevice));
bool Supported = (ZeResult != ZE_RESULT_ERROR_UNSUPPORTED_FEATURE &&
ZeResult != ZE_RESULT_ERROR_UNSUPPORTED_VERSION);
ZeDeviceSynchronizeSupported = Supported;
}

return UR_RESULT_SUCCESS;
}

Expand Down
5 changes: 5 additions & 0 deletions unified-runtime/source/adapters/level_zero/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,9 @@ struct ur_platform_handle_t_ : ur::handle_base<ur::level_zero::ddi_getter>,
void *pUserData, void *pNext, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents);
} ZeHostTaskExt;

// Flag to indicate whether zeDeviceSynchronize is supported.
// Some platforms may not support this API due to frozen driver, eg. gen12 on
// Windows. For details, see https://github.com/intel/llvm/issues/20927.
bool ZeDeviceSynchronizeSupported{false};
};
Loading