subgroups: Fix setting cl_halfs and progress check. (#1278)

* subgroups: Fix setting cl_halfs and progress check.

cl_float testing uses set_value such that a generated cl_ulong of 1 is
stored as 1.0F in a logical sense. However, cl_half values aren't
intrinsic to C++ and generated cl_ulongs less than 1024 in particular
are interpreted bitwise as subnormals. The test fails on compute devices
lacking subnormal support. Perform the logical conversion to cl_half.

Fix independent forward progress check.

* subgroups_half: Address review comments

* subgroups_half: Formatting fixes required by check-format

* subgroups_half: Modified to query and use rounding mode supported by device

Co-authored-by: spauls <spauls@qti.qualcomm.com>
This commit is contained in:
Sreelakshmi Haridas Maruthur
2021-07-21 01:51:29 -06:00
committed by GitHub
parent 12637114ac
commit 79f692d8e5
4 changed files with 36 additions and 13 deletions

View File

@@ -28,6 +28,7 @@
#define NR_OF_ACTIVE_WORK_ITEMS 4
extern MTdata gMTdata;
extern cl_half_rounding_mode g_rounding_mode;
struct WorkGroupParams
{
@@ -1080,7 +1081,7 @@ template <typename Ty>
typename std::enable_if<TypeManager<Ty>::is_sb_scalar_type::value>::type
set_value(Ty &lhs, const cl_ulong &rhs)
{
lhs.data = rhs;
lhs.data = cl_half_from_float(static_cast<cl_float>(rhs), g_rounding_mode);
}
// compare for common vectors