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-11-08 20:38:22 +0800 |
commit | c1859806b46ec22cf425cc4d199f82f6b8b5ea1c (patch) | |
tree | d01aacea7fd581812f1fb1f158b6eebdbfd6ef9a /utests/compiler_sampler.cpp | |
parent | 9fb5991520ad2608a7058913eb0ec83451dbc466 (diff) | |
download | beignet-c1859806b46ec22cf425cc4d199f82f6b8b5ea1c.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>
Diffstat (limited to 'utests/compiler_sampler.cpp')
-rw-r--r-- | utests/compiler_sampler.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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); } } |