summaryrefslogtreecommitdiff
path: root/utests/compiler_write_only.cpp
diff options
context:
space:
mode:
authorBenjamin Segovia <segovia.benjamin@gmail.com>2012-05-03 17:12:18 +0000
committerKeith Packard <keithp@keithp.com>2012-08-10 16:16:59 -0700
commit14430f2092f27a4fda9d8d80be90373388a06801 (patch)
tree5fa0ec1d8cf63d3c8c033d5e389130a0cbaf4851 /utests/compiler_write_only.cpp
parentccd746d3af1a4778e5c145fb752ea5a739f70840 (diff)
downloadbeignet-14430f2092f27a4fda9d8d80be90373388a06801.tar.gz
Finished the small test framework
Diffstat (limited to 'utests/compiler_write_only.cpp')
-rw-r--r--utests/compiler_write_only.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/utests/compiler_write_only.cpp b/utests/compiler_write_only.cpp
index f7382532..b42bfd22 100644
--- a/utests/compiler_write_only.cpp
+++ b/utests/compiler_write_only.cpp
@@ -22,23 +22,22 @@
void compiler_write_only(void)
{
const size_t n = 2048;
- int status = 0;
- CALL (cl_test_init, "test_write_only.cl", "test_write_only", SOURCE);
+ // Setup kernel and buffers
+ OCL_CREATE_KERNEL("test_write_only");
OCL_CREATE_BUFFER(buf[0], 0, n * sizeof(uint32_t), NULL);
OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
+
+ // Run the kernel
globals[0] = n;
locals[0] = 16;
OCL_NDRANGE(1);
OCL_MAP_BUFFER(0);
- for (uint32_t i = 0; i < n; ++i) assert(((uint32_t*)buf_data[0])[i] == i);
- OCL_UNMAP_BUFFER(0);
-error:
- cl_release_buffers();
- cl_report_error(status);
- cl_test_destroy();
+ // Check results
+ for (uint32_t i = 0; i < n; ++i)
+ OCL_ASSERT(((uint32_t*)buf_data[0])[i] == i);
}
-UTEST_REGISTER(compiler_write_only);
+MAKE_UTEST_FROM_FUNCTION(compiler_write_only);