summaryrefslogtreecommitdiff
path: root/utests/utest_helper.hpp
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2013-01-16 17:28:40 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-04-10 14:51:32 +0800
commita928cdd4fae6b1a42cb2d2229dca7c0a2c29e7f8 (patch)
treef625e9fd2f60f25ecbb11ba9ebcbf5fd653f7fac /utests/utest_helper.hpp
parent98e96af264f72933f23c485110a4a643eab84894 (diff)
downloadbeignet-a928cdd4fae6b1a42cb2d2229dca7c0a2c29e7f8.tar.gz
utest: Added some new helper macros for image2d test cases.
This is the first commit to prepare to add some image 2d test cases. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Lu Guanqun <guanqun.lu@intel.com>
Diffstat (limited to 'utests/utest_helper.hpp')
-rw-r--r--utests/utest_helper.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/utests/utest_helper.hpp b/utests/utest_helper.hpp
index e1f2395c..7987e751 100644
--- a/utests/utest_helper.hpp
+++ b/utests/utest_helper.hpp
@@ -64,6 +64,20 @@
if (status != CL_SUCCESS) OCL_THROW_ERROR(FN, status); \
} while (0)
+#define OCL_CREATE_IMAGE(IMAGE, FLAGS, FORMAT, W, H, PITCH, DATA) \
+ do { \
+ cl_int status; \
+ IMAGE = clCreateImage2D(ctx, FLAGS, FORMAT, W, H, PITCH, DATA, &status);\
+ if (status != CL_SUCCESS) OCL_THROW_ERROR(FN, status); \
+ } while (0)
+
+#define OCL_CREATE_SAMPLER(SAMPLER, ADDRESS_MODE, FILTER_MODE) \
+ do { \
+ cl_int status; \
+ SAMPLER = clCreateSampler(ctx, 0, CL_ADDRESS_CLAMP, CL_FILTER_NEAREST, &status);\
+ if (status != CL_SUCCESS) OCL_THROW_ERROR(FN, status); \
+ } while(0)
+
#define OCL_MAP_BUFFER(ID) \
do { \
cl_int status; \