summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-11-23 08:45:59 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-03-29 18:41:33 +0800
commitf1e09825e5387ad3d06eda92040c44ac2697c79b (patch)
tree48f7a73090c20653c9e1eefce799472b6c22df78
parentb5d68f0c9e9201c8acbb19f85b932f943c99d14d (diff)
downloadbeignet-f1e09825e5387ad3d06eda92040c44ac2697c79b.tar.gz
test OpenCL 1.1 sampler declaration fields
-rw-r--r--kernels/compiler_sampler.cl25
-rw-r--r--utests/compiler_sampler.cpp2
2 files changed, 27 insertions, 0 deletions
diff --git a/kernels/compiler_sampler.cl b/kernels/compiler_sampler.cl
new file mode 100644
index 00000000..149bbf19
--- /dev/null
+++ b/kernels/compiler_sampler.cl
@@ -0,0 +1,25 @@
+/* test OpenCL 1.1 sampler declaration */
+__kernel void compiler_sampler () {
+#define S(A,B,C) CLK_NORMALIZED_COORDS_##A | CLK_ADDRESS_##B | CLK_FILTER_##C
+ const sampler_t \
+ s0 = S(TRUE,REPEAT,NEAREST),
+ s1 = S(TRUE,REPEAT,LINEAR),
+ s2 = S(TRUE,CLAMP,NEAREST),
+ s3 = S(TRUE,CLAMP,LINEAR),
+ s4 = S(TRUE,NONE,NEAREST),
+ s5 = S(TRUE,NONE,LINEAR),
+ s6 = S(TRUE,CLAMP_TO_EDGE,NEAREST),
+ s7 = S(TRUE,CLAMP_TO_EDGE,LINEAR),
+ s8 = S(TRUE,MIRRORED_REPEAT,NEAREST),
+ s9 = S(TRUE,MIRRORED_REPEAT,LINEAR),
+ s10 = S(FALSE,REPEAT,NEAREST),
+ s11 = S(FALSE,REPEAT,LINEAR),
+ s12 = S(FALSE,CLAMP,NEAREST),
+ s13 = S(FALSE,CLAMP,LINEAR),
+ s14 = S(FALSE,NONE,NEAREST),
+ s15 = S(FALSE,NONE,LINEAR),
+ s16 = S(FALSE,CLAMP_TO_EDGE,NEAREST),
+ s17 = S(FALSE,CLAMP_TO_EDGE,LINEAR),
+ s18 = S(FALSE,MIRRORED_REPEAT,NEAREST),
+ s19 = S(FALSE,MIRRORED_REPEAT,LINEAR);
+}
diff --git a/utests/compiler_sampler.cpp b/utests/compiler_sampler.cpp
index 807263ea..32bf9263 100644
--- a/utests/compiler_sampler.cpp
+++ b/utests/compiler_sampler.cpp
@@ -3,6 +3,8 @@
void compiler_sampler(void)
{
+ OCL_CREATE_KERNEL("compiler_sampler");
+
OCL_ASSERT(ctx != 0);
cl_sampler s;
cl_int err;