[libclc] 07/92: Add halfN types and enable fp16 when generating builtin declarations

Andreas Boll aboll-guest at moszumanska.debian.org
Mon Nov 6 15:11:55 UTC 2017


This is an automated email from the git hooks/post-receive script.

aboll-guest pushed a commit to branch master
in repository libclc.

commit 84fe1c0948051a1d298a769bbce46cdd026e9623
Author: Aaron Watry <awatry at gmail.com>
Date:   Sat Sep 2 02:23:16 2017 +0000

    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 at gmail.com>
    Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@312402 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/clc.h      | 4 ++++
 generic/include/clc/clctypes.h | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index deb9d70..059cb7f 100644
--- a/generic/include/clc/clc.h
+++ b/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/generic/include/clc/clctypes.h b/generic/include/clc/clctypes.h
index 8308bda..76b816d 100644
--- a/generic/include/clc/clctypes.h
+++ b/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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list