diff options
| author | Aaron Watry <awatry@gmail.com> | 2017-09-02 02:23:16 +0000 |
|---|---|---|
| committer | Aaron Watry <awatry@gmail.com> | 2017-09-02 02:23:16 +0000 |
| commit | da8dfefd1c95eda6bbac51dddaf36a55b03abd9e (patch) | |
| tree | 3f38a735622925e3bcd5b250fb53e81574476c93 /libclc | |
| parent | 94090dd13b18169c3c5cd87dbac8e6184a1e3a3f (diff) | |
| download | bcm5719-llvm-da8dfefd1c95eda6bbac51dddaf36a55b03abd9e.tar.gz bcm5719-llvm-da8dfefd1c95eda6bbac51dddaf36a55b03abd9e.zip | |
Add halfN types and enable fp16 when generating builtin declarations
Uses the same mechanism to enable fp16 as we use for fp64 when
processing clc.h
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 312402
Diffstat (limited to 'libclc')
| -rw-r--r-- | libclc/generic/include/clc/clc.h | 4 | ||||
| -rw-r--r-- | libclc/generic/include/clc/clctypes.h | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h index deb9d70f784..059cb7f4313 100644 --- a/libclc/generic/include/clc/clc.h +++ b/libclc/generic/include/clc/clc.h @@ -8,6 +8,10 @@ #pragma OPENCL EXTENSION cl_khr_fp64 : enable #endif +#ifdef cl_khr_fp16 +#pragma OPENCL EXTENSION cl_khr_fp16 : enable +#endif + /* Function Attributes */ #include <clc/clcfunc.h> diff --git a/libclc/generic/include/clc/clctypes.h b/libclc/generic/include/clc/clctypes.h index 8308bda7087..76b816d395c 100644 --- a/libclc/generic/include/clc/clctypes.h +++ b/libclc/generic/include/clc/clctypes.h @@ -85,3 +85,11 @@ typedef __attribute__((ext_vector_type(4))) double double4; typedef __attribute__((ext_vector_type(8))) double double8; typedef __attribute__((ext_vector_type(16))) double double16; #endif + +#ifdef cl_khr_fp16 +typedef __attribute__((ext_vector_type(2))) half half2; +typedef __attribute__((ext_vector_type(3))) half half3; +typedef __attribute__((ext_vector_type(4))) half half4; +typedef __attribute__((ext_vector_type(8))) half half8; +typedef __attribute__((ext_vector_type(16))) half half16; +#endif |

