Skip to content

Commit 32957aa

Browse files
committed
[UR] Stop querying adapter fp16/fp64 support via extension.
1 parent ec37e17 commit 32957aa

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ 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
# commit c742ca49efb12380a35b8b0b467e6577ab8174ce
121121
# Merge: 3a8bf2c5 504d3b63
122122
# Author: Kenneth Benzie (Benie) <[email protected]>
123123
# Date: Mon Oct 21 11:55:23 2024 +0100
124124
# Merge pull request #2131 from Bensuo/ben/command-handle-fix
125125
# [EXP][CMDBUF] Make command handle behaviour consistent
126-
set(UNIFIED_RUNTIME_TAG c742ca49efb12380a35b8b0b467e6577ab8174ce)
126+
set(UNIFIED_RUNTIME_TAG aaron/stopReportingFPExtensions)
127127

128128
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
129129
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need

sycl/source/detail/device_impl.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ bool device_impl::has(aspect Aspect) const {
367367
case aspect::host_debuggable:
368368
return false;
369369
case aspect::fp16:
370-
return has_extension("cl_khr_fp16");
370+
return isFp16Supported();
371371
case aspect::fp64:
372-
return has_extension("cl_khr_fp64");
372+
return isFp64Supported();
373373
case aspect::int64_base_atomics:
374374
return has_extension("cl_khr_int64_base_atomics");
375375
case aspect::int64_extended_atomics:
@@ -800,6 +800,20 @@ ext::oneapi::experimental::architecture device_impl::getDeviceArch() const {
800800
return MDeviceArch;
801801
}
802802

803+
bool device_impl::isFp16Supported() const {
804+
auto Fp16Config = get_info<info::device::half_fp_config>();
805+
// If we don't get anything back from this we can assume the device doesn't
806+
// support fp16.
807+
return Fp16Config.empty() ? false : true;
808+
}
809+
810+
bool device_impl::isFp64Supported() const {
811+
auto Fp64Config = get_info<info::device::double_fp_config>();
812+
// If we don't get anything back from this we can assume the device doesn't
813+
// support fp64.
814+
return Fp64Config.empty() ? false : true;
815+
}
816+
803817
// On the first call this function queries for device timestamp
804818
// along with host synchronized timestamp and stores it in member variable
805819
// MDeviceHostBaseTime. Subsequent calls to this function would just retrieve

sycl/source/detail/device_impl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ class device_impl {
293293
/// Get device architecture
294294
ext::oneapi::experimental::architecture getDeviceArch() const;
295295

296+
// Check if the device supports double precision floating point.
297+
bool isFp64Supported() const;
298+
299+
// Check if the device supports half precision floating point.
300+
bool isFp16Supported() const;
301+
296302
private:
297303
explicit device_impl(ur_native_handle_t InteropDevice,
298304
ur_device_handle_t Device, PlatformImplPtr Platform,

0 commit comments

Comments
 (0)