Skip to content
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

added cl_half support for test_conversions #1669

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4435413
Added unification of existing conversions test as preparation for cl_…
shajder Feb 28, 2023
3ffa735
Unified initialization procedures for conversions test.
shajder Mar 1, 2023
9cc33b8
Completed unification of data structures to handle cl_khr_fp16
shajder Mar 2, 2023
4871029
Added support for selective launch of the test
shajder Mar 3, 2023
6e16597
Added half support for test_conversions, work in progres (issue #142,…
shajder Mar 8, 2023
f547880
Added more work on halfs support for conversions test (issue #142, co…
shajder Mar 9, 2023
7429255
Added cosmetic corrections
shajder Mar 9, 2023
3acf243
Merge branch 'main' into fp16_conversions
shajder Mar 9, 2023
282856b
Added more cosmetic corrections before opening draft PR
shajder Mar 9, 2023
95cc0e6
Added corrections related to pre-submit windows build
shajder Mar 9, 2023
dc6ab32
Added more pre-build related corrections
shajder Mar 9, 2023
d66d269
Added pre-submit ubuntu build related correction
shajder Mar 9, 2023
51f33c5
Added more pre-submit related corrections
shajder Mar 9, 2023
85cbaab
Divided structures into separate source files (issue #142, conversions)
shajder Apr 11, 2023
6779326
Merge branch 'main' into fp16_conversions
shajder Apr 11, 2023
89794a6
Added more corrections related to presubmit check
shajder Apr 12, 2023
84b511e
Removed redeclarations due to presubmit check
shajder Apr 12, 2023
53e0854
Added more corrections related to presubmit check arm build
shajder Apr 12, 2023
0ffbeb1
Added cosmetic correction
shajder Apr 12, 2023
f815d9e
Adapted modifications from related PR #1719 to avoid merging conflicts
shajder Jun 23, 2023
87d148b
Merge branch 'main' into fp16_conversions
shajder Jun 23, 2023
c6fd096
fixed clang format
shajder Jun 23, 2023
4e56757
Merge remote-tracking branch 'github/main' into fp16_conversions
EwanC Aug 31, 2023
1f20b5c
Merge branch 'main' into fp16_conversions
shajder Nov 9, 2023
271c3af
Added corrections related to code review (cl_khr_fp16 suuport accordi…
shajder Nov 15, 2023
26c507f
Corrections related to macos CI check fail
shajder Nov 15, 2023
a99d062
fix for unclear clang format discrepancy
shajder Nov 15, 2023
26bac40
More corrections related to code review (cl_khr_fp16 for conversions …
shajder Nov 29, 2023
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
23 changes: 17 additions & 6 deletions test_common/harness/kernelHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,22 +1511,33 @@ size_t get_min_alignment(cl_context context)
return align_size;
}

cl_device_fp_config get_default_rounding_mode(cl_device_id device)
cl_device_fp_config get_default_rounding_mode(cl_device_id device,
const cl_uint &param)
{
if (param == CL_DEVICE_DOUBLE_FP_CONFIG)
test_error_ret(
-1,
"FAILURE: CL_DEVICE_DOUBLE_FP_CONFIG not supported by this routine",
0);

char profileStr[128] = "";
cl_device_fp_config single = 0;
int error = clGetDeviceInfo(device, CL_DEVICE_SINGLE_FP_CONFIG,
sizeof(single), &single, NULL);
int error = clGetDeviceInfo(device, param, sizeof(single), &single, NULL);
if (error)
test_error_ret(error, "Unable to get device CL_DEVICE_SINGLE_FP_CONFIG",
0);
{
std::string message = std::string("Unable to get device ")
+ std::string(param == CL_DEVICE_HALF_FP_CONFIG
? "CL_DEVICE_HALF_FP_CONFIG"
: "CL_DEVICE_SINGLE_FP_CONFIG");
test_error_ret(error, message.c_str(), 0);
}

if (single & CL_FP_ROUND_TO_NEAREST) return CL_FP_ROUND_TO_NEAREST;

if (0 == (single & CL_FP_ROUND_TO_ZERO))
test_error_ret(-1,
"FAILURE: device must support either "
"CL_DEVICE_SINGLE_FP_CONFIG or CL_FP_ROUND_TO_NEAREST",
"CL_FP_ROUND_TO_ZERO or CL_FP_ROUND_TO_NEAREST",
0);

// Make sure we are an embedded device before allowing a pass
Expand Down
4 changes: 3 additions & 1 deletion test_common/harness/kernelHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ size_t get_min_alignment(cl_context context);

/* Helper to obtain the default rounding mode for single precision computation.
* (Double is always CL_FP_ROUND_TO_NEAREST.) Returns 0 on error. */
cl_device_fp_config get_default_rounding_mode(cl_device_id device);
cl_device_fp_config
get_default_rounding_mode(cl_device_id device,
const cl_uint &param = CL_DEVICE_SINGLE_FP_CONFIG);

#define PASSIVE_REQUIRE_IMAGE_SUPPORT(device) \
if (checkForImageSupport(device)) \
Expand Down
9 changes: 5 additions & 4 deletions test_common/harness/rounding_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ typedef enum
kshort = 3,
kuint = 4,
kint = 5,
kfloat = 6,
kdouble = 7,
kulong = 8,
klong = 9,
khalf = 6,
kfloat = 7,
kdouble = 8,
kulong = 9,
klong = 10,

// This goes last
kTypeCount
Expand Down
Loading