Skip to content

Commit cedd602

Browse files
committed
[UR] Add device info query for devicelib assert.
1 parent d130196 commit cedd602

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ if(SYCL_UR_USE_FETCH_CONTENT)
116116
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
117117
endfunction()
118118

119-
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
119+
set(UNIFIED_RUNTIME_REPO "https://github.com/aarongreig/unified-runtime.git")
120120
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/UnifiedRuntimeTag.cmake)
121121

122122
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
# commit 3d58884b4939d9bd095c917f8dd823ac8486684c
2-
# Merge: 6ade245e b0bd146a
3-
# Author: aarongreig <[email protected]>
4-
# Date: Thu Oct 31 14:05:55 2024 +0000
5-
# Merge pull request #2228 from nrspruit/copy_engine_refactor
6-
# [L0] Refactor Copy Engine Usage checks for Performance
7-
set(UNIFIED_RUNTIME_TAG 3d58884b4939d9bd095c917f8dd823ac8486684c)
1+
set(UNIFIED_RUNTIME_TAG aaron/addAssertDeviceInfoQuery)

sycl/source/detail/device_impl.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ device_impl::device_impl(ur_native_handle_t InteropDeviceHandle,
7373
}
7474
MPlatform = Platform;
7575

76-
MIsAssertFailSupported =
77-
has_extension(UR_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT);
76+
Adapter->call<UrApiKind::urDeviceGetInfo>(
77+
MDevice, UR_DEVICE_INFO_USE_NATIVE_ASSERT, sizeof(ur_bool_t),
78+
&MUseNativeAssert, nullptr);
7879
}
7980

8081
device_impl::~device_impl() {
@@ -472,7 +473,7 @@ bool device_impl::has(aspect Aspect) const {
472473
case aspect::ext_oneapi_srgb:
473474
return get_info<info::device::ext_oneapi_srgb>();
474475
case aspect::ext_oneapi_native_assert:
475-
return isAssertFailSupported();
476+
return useNativeAssert();
476477
case aspect::ext_oneapi_cuda_async_barrier: {
477478
int async_barrier_supported;
478479
bool call_successful =
@@ -782,9 +783,7 @@ bool device_impl::has(aspect Aspect) const {
782783
return false; // This device aspect has not been implemented yet.
783784
}
784785

785-
bool device_impl::isAssertFailSupported() const {
786-
return MIsAssertFailSupported;
787-
}
786+
bool device_impl::useNativeAssert() const { return MUseNativeAssert; }
788787

789788
std::string device_impl::getDeviceName() const {
790789
std::call_once(MDeviceNameFlag,

sycl/source/detail/device_impl.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,12 @@ class device_impl {
209209
/// \return true if the SYCL device has the given feature.
210210
bool has(aspect Aspect) const;
211211

212-
bool isAssertFailSupported() const;
212+
/// Indicates the SYCL device prefers to use its native assert
213+
/// implementation.
214+
///
215+
/// If this is false we will use the fallback assert implementation,
216+
/// as detailed in doc/design/Assert.md
217+
bool useNativeAssert() const;
213218

214219
bool isRootDevice() const { return MRootDevice == nullptr; }
215220

@@ -302,7 +307,7 @@ class device_impl {
302307
ur_device_type_t MType;
303308
ur_device_handle_t MRootDevice = nullptr;
304309
PlatformImplPtr MPlatform;
305-
bool MIsAssertFailSupported = false;
310+
bool MUseNativeAssert = false;
306311
mutable std::string MDeviceName;
307312
mutable std::once_flag MDeviceNameFlag;
308313
mutable ext::oneapi::experimental::architecture MDeviceArch{};

0 commit comments

Comments
 (0)