diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2016-03-01 03:51:57 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-03-15 14:27:58 +0800 |
commit | 8559a5a2d52eda3c58a3310a9cd0abb47479336a (patch) | |
tree | 6d29bef582198f2d2e94dee9f8c3953e1515d174 | |
parent | 7dd1e3fc4e938b7493b20a136c8b989faaf722af (diff) | |
download | beignet-8559a5a2d52eda3c58a3310a9cd0abb47479336a.tar.gz |
Utest: Add sampler test
Reuse sampler test and add test for new api
clCreateSamplerWithProperties.
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | utests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | utests/compiler_sampler.cpp | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt index 9b37bf77..adbbf25c 100644 --- a/utests/CMakeLists.txt +++ b/utests/CMakeLists.txt @@ -60,6 +60,7 @@ set (utests_sources compiler_copy_buffer_row.cpp compiler_degrees.cpp compiler_step.cpp + compiler_sampler.cpp compiler_fabs.cpp compiler_abs.cpp compiler_abs_diff.cpp diff --git a/utests/compiler_sampler.cpp b/utests/compiler_sampler.cpp index 32bf9263..f8bf622c 100644 --- a/utests/compiler_sampler.cpp +++ b/utests/compiler_sampler.cpp @@ -8,7 +8,7 @@ void compiler_sampler(void) OCL_ASSERT(ctx != 0); cl_sampler s; cl_int err; - int a1[] = {CL_TRUE, CL_FALSE}, + cl_uint a1[] = {CL_TRUE, CL_FALSE}, a2[] = {CL_ADDRESS_MIRRORED_REPEAT, CL_ADDRESS_REPEAT, CL_ADDRESS_CLAMP_TO_EDGE, @@ -33,6 +33,18 @@ void compiler_sampler(void) for(l=0; l<5; l++) OCL_CALL(clGetSamplerInfo, s, a4[l], 1000, pv, &pv_size); OCL_CALL(clReleaseSampler, s); + cl_sampler_properties sam[] = { + CL_SAMPLER_NORMALIZED_COORDS, a1[i], + CL_SAMPLER_ADDRESSING_MODE, a2[j], + CL_SAMPLER_FILTER_MODE, a3[k], + 0}; + s = clCreateSamplerWithProperties(ctx, sam, &err); + OCL_ASSERT(err == CL_SUCCESS); + OCL_CALL(clRetainSampler, s); + OCL_CALL(clReleaseSampler, s); + for(l=0; l<5; l++) + OCL_CALL(clGetSamplerInfo, s, a4[l], 1000, pv, &pv_size); + OCL_CALL(clReleaseSampler, s); } } |