Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
32957aa
[UR] Stop querying adapter fp16/fp64 support via extension.
aarongreig Oct 22, 2024
5e66ecc
Simplify device info helpers
aarongreig Oct 22, 2024
8720fbe
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Oct 24, 2024
368a9e8
Rely on empty bitfield to report no type support
aarongreig Oct 28, 2024
d789703
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Oct 29, 2024
5358def
Revert change made for testing.
aarongreig Oct 29, 2024
b3b7153
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Jan 22, 2025
fba0498
Clean up some remaining uses of the old extension string.
aarongreig Jan 23, 2025
3049632
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Jan 23, 2025
ee0fc6c
Fix unit tests.
aarongreig Jan 23, 2025
189bf35
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Feb 4, 2025
62803c0
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Feb 24, 2025
3e22484
Report device fp support via config rather than extension string.
aarongreig Oct 22, 2024
461ca20
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Mar 7, 2025
f3ab64a
Fix formatting.
aarongreig Mar 10, 2025
8b55b79
Fix another bad conflict resolution.
aarongreig Mar 10, 2025
e965b3e
Adjust minimum flags in native cpu and link related issue.
aarongreig Mar 19, 2025
9ecf00b
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Mar 19, 2025
3f13197
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Jul 17, 2025
f5bcab7
Fix hip build.
aarongreig Jul 18, 2025
797dd4c
Fix unit tests and report proper vec widths for hip + cuda.
aarongreig Jul 21, 2025
b9017b9
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Jul 21, 2025
a9932cc
Merge branch 'sycl' into aaron/stopReportingFPExtensions
aarongreig Jul 29, 2025
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
2 changes: 1 addition & 1 deletion sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if(SYCL_UR_USE_FETCH_CONTENT)
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
endfunction()

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

set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
Expand Down
8 changes: 1 addition & 7 deletions sycl/cmake/modules/UnifiedRuntimeTag.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# commit dbd168cbed2d2590b47904728cd5762f1c2f4c6b (HEAD, origin/main, origin/HEAD)
# Merge: 694c1b9a 27ad3f7d
# Author: Piotr Balcer <[email protected]>
# Date: Mon Oct 28 16:29:45 2024 +0100
# Merge pull request #2242 from nrspruit/sysman_env_disable
# [L0] Enable Sysman Thru Env by default and have zesInit be optional
set(UNIFIED_RUNTIME_TAG dbd168cbed2d2590b47904728cd5762f1c2f4c6b)
set(UNIFIED_RUNTIME_TAG aaron/stopReportingFPExtensions)
16 changes: 14 additions & 2 deletions sycl/source/detail/device_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ bool device_impl::has(aspect Aspect) const {
case aspect::host_debuggable:
return false;
case aspect::fp16:
return has_extension("cl_khr_fp16");
return isFp16Supported();
case aspect::fp64:
return has_extension("cl_khr_fp64");
return isFp64Supported();
case aspect::int64_base_atomics:
return has_extension("cl_khr_int64_base_atomics");
case aspect::int64_extended_atomics:
Expand Down Expand Up @@ -800,6 +800,18 @@ ext::oneapi::experimental::architecture device_impl::getDeviceArch() const {
return MDeviceArch;
}

bool device_impl::isFp16Supported() const {
// If we don't get anything back from this we can assume the device doesn't
// support fp16.
return !get_info<info::device::half_fp_config>().empty();
}

bool device_impl::isFp64Supported() const {
// If we don't get anything back from this we can assume the device doesn't
// support fp64.
return !get_info<info::device::double_fp_config>().empty();
}

// On the first call this function queries for device timestamp
// along with host synchronized timestamp and stores it in member variable
// MDeviceHostBaseTime. Subsequent calls to this function would just retrieve
Expand Down
6 changes: 6 additions & 0 deletions sycl/source/detail/device_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ class device_impl {
/// Get device architecture
ext::oneapi::experimental::architecture getDeviceArch() const;

// Check if the device supports double precision floating point.
bool isFp64Supported() const;

// Check if the device supports half precision floating point.
bool isFp16Supported() const;

Comment on lines +2254 to +2259
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add extra methods. Existing interfaces should be enough, just change their implementation to the proper calls to the underlying UR queries.

private:
explicit device_impl(ur_native_handle_t InteropDevice,
ur_device_handle_t Device, PlatformImplPtr Platform,
Expand Down
6 changes: 0 additions & 6 deletions sycl/source/detail/device_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,6 @@ struct get_device_info_impl<ReturnT, info::device::parent_device> {
template <typename Param>
struct get_device_info_impl<std::vector<info::fp_config>, Param> {
static std::vector<info::fp_config> get(const DeviceImplPtr &Dev) {
// Check if fp type is supported
if (!get_device_info_impl<
typename check_fp_support<Param>::type::return_type,
typename check_fp_support<Param>::type>::get(Dev)) {
return {};
}
ur_device_fp_capability_flags_t result;
Dev->getAdapter()->call<UrApiKind::urDeviceGetInfo>(
Dev->getHandleRef(), UrInfoCode<Param>::value, sizeof(result), &result,
Expand Down
18 changes: 18 additions & 0 deletions sycl/unittests/helpers/UrMock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,24 @@ inline ur_result_t mock_urDeviceGetInfo(void *pParams) {
**params->ppPropSizeRet = 0;
}
return UR_RESULT_SUCCESS;
case UR_DEVICE_INFO_SINGLE_FP_CONFIG:
case UR_DEVICE_INFO_HALF_FP_CONFIG:
case UR_DEVICE_INFO_DOUBLE_FP_CONFIG:
if (*params->ppPropValue) {
// This is the minimum requirement for a device reporting support for a
// given FP type.
ur_device_fp_capability_flags_t capabilities =
UR_DEVICE_FP_CAPABILITY_FLAG_DENORM |
UR_DEVICE_FP_CAPABILITY_FLAG_INF_NAN |
UR_DEVICE_FP_CAPABILITY_FLAG_ROUND_TO_NEAREST |
UR_DEVICE_FP_CAPABILITY_FLAG_FMA;
*static_cast<ur_device_fp_capability_flags_t *>(*params->ppPropValue) =
capabilities;
}
if (*params->ppPropSizeRet) {
**params->ppPropSizeRet = sizeof(ur_device_fp_capability_flags_t);
}
return UR_RESULT_SUCCESS;
default: {
// In the default case we fill the return value with 0's. This may not be
// valid for all device queries, but it will mean a consistent return value
Expand Down
Loading