From c1859806b46ec22cf425cc4d199f82f6b8b5ea1c Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Tue, 1 Mar 2016 03:51:57 +0800 Subject: Utest: Add sampler test Reuse sampler test and add test for new api clCreateSamplerWithProperties. Signed-off-by: Pan Xiuli Reviewed-by: Yang Rong --- utests/compiler_sampler.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'utests/compiler_sampler.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); } } -- cgit v1.2.1