[Libclc-dev] [PATCH 3/3] Add half limits

Jeroen Ketema j.ketema at imperial.ac.uk
Tue Jun 24 02:59:34 PDT 2014


Committed. Thanks for the review.

Jeroen

On 23 Jun 2014, at 17:25, Tom Stellard <tom at stellard.net> wrote:

> On Mon, Jun 23, 2014 at 04:37:22PM +0100, Jeroen Ketema wrote:
>> These are apparently only defined by OpenCL 1.2.
>> 
> 
> LGTM.
> 
>> I also tried adding HALF_MAX, HALF_MIN, and HALF_EPSILON. However, clang does
>> not seem to support the ‘h’ suffix even with the cl_khr_fp16 extension enabled.
> 
> Is the `h' suffix something that is required to be supported by the OpenCL 2.0 spec?
> 
> -Tom
> 
>> ---
>> generic/include/clc/float/definitions.h | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>> 
>> diff --git a/generic/include/clc/float/definitions.h b/generic/include/clc/float/definitions.h
>> index cd65324..6d532a5 100644
>> --- a/generic/include/clc/float/definitions.h
>> +++ b/generic/include/clc/float/definitions.h
>> @@ -46,3 +46,18 @@
>> #define M_PI            0x1.921fb54442d18p+1
>> 
>> #endif
>> +
>> +#ifdef cl_khr_fp16
>> +
>> +#if __OPENCL_VERSION__ >= CL_VERSION_1_2
>> +
>> +#define HALF_DIG        3
>> +#define HALF_MANT_DIG   11
>> +#define HALF_MAX_10_EXP +4
>> +#define HALF_MAX_EXP    +16
>> +#define HALF_MIN_10_EXP -4
>> +#define HALF_MIN_EXP    -13
>> +
>> +#endif
>> +
>> +#endif
>> -- 
>> 1.8.5.2 (Apple Git-48)
>> 
>> 
>> _______________________________________________
>> Libclc-dev mailing list
>> Libclc-dev at pcc.me.uk
>> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev





More information about the Libclc-dev mailing list