[Beignet] [Patch v2 10/10] change the sampler type value to keep same with spir spec.

xionghu.luo at intel.com xionghu.luo at intel.com
Wed Nov 25 22:00:05 PST 2015


From: Luo Xionghu <xionghu.luo at intel.com>

these value are defined in 2.1.3.1 @ spir_spec-1.2.pdf.

v2: include new patch.
Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 backend/src/ocl_common_defines.h | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/backend/src/ocl_common_defines.h b/backend/src/ocl_common_defines.h
index 52f5365..42e6cc4 100644
--- a/backend/src/ocl_common_defines.h
+++ b/backend/src/ocl_common_defines.h
@@ -67,12 +67,19 @@ typedef enum clk_channel_type {
 }clk_channel_type;
 
 typedef enum clk_sampler_type {
+    __CLK_NORMALIZED_BASE          = 0,
+    CLK_NORMALIZED_COORDS_FALSE    = 0,
+    CLK_NORMALIZED_COORDS_TRUE     = (1 << __CLK_NORMALIZED_BASE),
+    __CLK_NORMALIZED_MASK          = (CLK_NORMALIZED_COORDS_FALSE |
+                                      CLK_NORMALIZED_COORDS_TRUE),
+    __CLK_NORMALIZED_BITS          = 1,        // number of bits required to
+                                               // represent normalization
     __CLK_ADDRESS_BASE             = 0,
     CLK_ADDRESS_NONE               = (0 << __CLK_ADDRESS_BASE),
-    CLK_ADDRESS_CLAMP              = (1 << __CLK_ADDRESS_BASE),
     CLK_ADDRESS_CLAMP_TO_EDGE      = (2 << __CLK_ADDRESS_BASE),
-    CLK_ADDRESS_REPEAT             = (3 << __CLK_ADDRESS_BASE),
-    CLK_ADDRESS_MIRROR             = (4 << __CLK_ADDRESS_BASE),
+    CLK_ADDRESS_CLAMP              = (4 << __CLK_ADDRESS_BASE),
+    CLK_ADDRESS_REPEAT             = (6 << __CLK_ADDRESS_BASE),
+    CLK_ADDRESS_MIRROR             = (8 << __CLK_ADDRESS_BASE),
 
 #if (__NV_CL_C_VERSION >= __NV_CL_C_VERSION_1_1)
     CLK_ADDRESS_MIRRORED_REPEAT    = CLK_ADDRESS_MIRROR,
@@ -80,20 +87,12 @@ typedef enum clk_sampler_type {
     __CLK_ADDRESS_MASK             = (CLK_ADDRESS_NONE | CLK_ADDRESS_CLAMP |
                                      CLK_ADDRESS_CLAMP_TO_EDGE |
                                      CLK_ADDRESS_REPEAT | CLK_ADDRESS_MIRROR),
-    __CLK_ADDRESS_BITS             = 3,        // number of bits required to
+    __CLK_ADDRESS_BITS             = 4,        // number of bits required to
                                                // represent address info
-
-    __CLK_NORMALIZED_BASE          = __CLK_ADDRESS_BITS,
-    CLK_NORMALIZED_COORDS_FALSE    = 0,
-    CLK_NORMALIZED_COORDS_TRUE     = (1 << __CLK_NORMALIZED_BASE),
-    __CLK_NORMALIZED_MASK          = (CLK_NORMALIZED_COORDS_FALSE |
-                                      CLK_NORMALIZED_COORDS_TRUE),
-    __CLK_NORMALIZED_BITS          = 1,        // number of bits required to
-                                               // represent normalization
-    __CLK_FILTER_BASE              = (__CLK_NORMALIZED_BASE +  __CLK_NORMALIZED_BITS),
-    CLK_FILTER_NEAREST             = (0 << __CLK_FILTER_BASE),
-    CLK_FILTER_LINEAR              = (1 << __CLK_FILTER_BASE),
-    CLK_FILTER_ANISOTROPIC         = (2 << __CLK_FILTER_BASE),
+    __CLK_FILTER_BASE              = (__CLK_ADDRESS_BASE +  __CLK_ADDRESS_BITS),
+    CLK_FILTER_ANISOTROPIC         = (0 << __CLK_FILTER_BASE),
+    CLK_FILTER_NEAREST             = (1 << __CLK_FILTER_BASE),
+    CLK_FILTER_LINEAR              = (2 << __CLK_FILTER_BASE),
     __CLK_FILTER_MASK              = (CLK_FILTER_NEAREST | CLK_FILTER_LINEAR |
                                      CLK_FILTER_ANISOTROPIC),
     __CLK_FILTER_BITS              = 2,        // number of bits required to
@@ -123,4 +122,4 @@ typedef enum clk_sampler_type {
 #define CLK_LOCAL_MEM_FENCE     (1 << 0)
 #define CLK_GLOBAL_MEM_FENCE    (1 << 1)
 
-#endif   /* __OCL_COMMON_DEFINES__ */
\ No newline at end of file
+#endif   /* __OCL_COMMON_DEFINES__ */
-- 
1.9.1



More information about the Beignet mailing list