-
Notifications
You must be signed in to change notification settings - Fork 124
Report device fp support via config rather than extension string. #2231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,10 +154,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, | |
| case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY: | ||
| return ReturnValue(bool{1}); | ||
| case UR_DEVICE_INFO_EXTENSIONS: | ||
| // TODO : Populate return string accordingly - e.g. cl_khr_fp16, | ||
| // cl_khr_fp64, cl_khr_int64_base_atomics, | ||
| // cl_khr_int64_extended_atomics | ||
| return ReturnValue("cl_khr_fp16, cl_khr_fp64 "); | ||
| return ReturnValue(""); | ||
| case UR_DEVICE_INFO_VERSION: | ||
| return ReturnValue("0.1"); | ||
| case UR_DEVICE_INFO_COMPILER_AVAILABLE: | ||
|
|
@@ -193,19 +190,18 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, | |
| case UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH: | ||
| // Default minimum values required by the SYCL specification. | ||
| return ReturnValue(size_t{2048}); | ||
| case UR_DEVICE_INFO_HALF_FP_CONFIG: { | ||
| // todo: | ||
| ur_device_fp_capability_flags_t HalfFPValue = 0; | ||
| return ReturnValue(HalfFPValue); | ||
| } | ||
| case UR_DEVICE_INFO_SINGLE_FP_CONFIG: { | ||
| // todo | ||
| ur_device_fp_capability_flags_t SingleFPValue = 0; | ||
| return ReturnValue(SingleFPValue); | ||
| } | ||
| case UR_DEVICE_INFO_HALF_FP_CONFIG: | ||
| case UR_DEVICE_INFO_SINGLE_FP_CONFIG: | ||
| case UR_DEVICE_INFO_DOUBLE_FP_CONFIG: { | ||
| ur_device_fp_capability_flags_t DoubleFPValue = 0; | ||
| return ReturnValue(DoubleFPValue); | ||
| // All fp types are supported, return minimum flags to indicate support. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we falsely say before we didn't support double etc?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no the adapter was reporting "cl_khr_fp16, cl_khr_fp64 " for UR_DEVICE_INFO_EXTENSIONS, which I've removed to replace with this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this bit didn't get called for the extensions then, but was still wrong? |
||
| // TODO: look at this in more detail. | ||
| ur_device_fp_capability_flags_t SupportedFlags = | ||
| 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; | ||
| ; | ||
| return ReturnValue(SupportedFlags); | ||
| } | ||
| case UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS: | ||
| return ReturnValue(uint32_t{3}); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think half support will depend on the architecture - although x86 seems to emulate - still this may still be better than what we had before, and we don't officially support the "bad" architectures I think yet.