mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-24 07:59:01 +00:00
Fixes for basic explicit_s2v and commonfns degrees for cl_half (#2024)
Basic explicit_s2v: The verification step was always using round to even when converting a float to half even for round to zero cores. Commonfns degrees: The verification step was only taking into account infinities and not values that over/underflow. This resulted in an incorrect error calculation. E.g: double cpu_result = 175668.85998711039; cl_half gpu_result = 31743; // this is 65504 when converting to float, we overflowed. float error = (cpu_result - gpu_result) * some_factor; The fix adds the check if( (cl_half) reference == test ) before calculating the error.
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <CL/cl_half.h>
|
||||
|
||||
/* Note: the next three all have to match in size and order!! */
|
||||
|
||||
enum ExplicitTypes
|
||||
@@ -71,6 +73,7 @@ extern const char *get_explicit_type_name(ExplicitType type);
|
||||
extern void convert_explicit_value(void *inRaw, void *outRaw,
|
||||
ExplicitType inType, bool saturate,
|
||||
RoundingType roundType,
|
||||
cl_half_rounding_mode halfRoundingMode,
|
||||
ExplicitType outType);
|
||||
|
||||
extern void generate_random_data(ExplicitType type, size_t count, MTdata d,
|
||||
|
||||
Reference in New Issue
Block a user