diff options
author | Benjamin Segovia <benjamin.segovia@intel.com> | 2012-11-02 21:12:41 -0700 |
---|---|---|
committer | Benjamin Segovia <benjamin.segovia@intel.com> | 2012-11-02 21:12:41 -0700 |
commit | 96c13a11afdbbc61a8da60f2ec8d6527386541c2 (patch) | |
tree | b09c6cb13a81d92555ddee8f28e38e7ab7fa9f10 /utests/compiler_mandelbrot.cpp | |
parent | 2c49b307dfb9fca7943632d5b9de704c036da4ba (diff) | |
download | beignet-96c13a11afdbbc61a8da60f2ec8d6527386541c2.tar.gz |
- Added reference images for all the remaining tests that need them
- Added a lengthy comment on instruction selection
- Added some new patters to improve immediate matching
Diffstat (limited to 'utests/compiler_mandelbrot.cpp')
-rw-r--r-- | utests/compiler_mandelbrot.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/utests/compiler_mandelbrot.cpp b/utests/compiler_mandelbrot.cpp index aa70f3de..7758dae3 100644 --- a/utests/compiler_mandelbrot.cpp +++ b/utests/compiler_mandelbrot.cpp @@ -20,9 +20,8 @@ #include "utest_helper.hpp" static int *dst = NULL; -static const size_t w = 64; -static const size_t h = 64; -static const size_t iter = 4; +static const size_t w = 256; +static const size_t h = 256; static void compiler_mandelbrot(void) { @@ -32,14 +31,17 @@ static void compiler_mandelbrot(void) OCL_CREATE_KERNEL("compiler_mandelbrot"); - cl_mem cl_dst = clCreateBuffer(ctx, 0, sz, NULL, NULL); - OCL_CALL (clSetKernelArg, kernel, 0, sizeof(cl_mem), &cl_dst); + OCL_CREATE_BUFFER(buf[0], 0, sz, NULL); + OCL_CALL (clSetKernelArg, kernel, 0, sizeof(cl_mem), &buf[0]); OCL_CALL (clEnqueueNDRangeKernel, queue, kernel, 2, NULL, global, local, 0, NULL, NULL); - dst = (int *) clIntelMapBuffer(cl_dst, NULL); + OCL_MAP_BUFFER(0); + dst = (int *) buf_data[0]; - cl_write_bmp(dst, w, h, "mandelbrot.bmp"); - OCL_CALL (clIntelUnmapBuffer, cl_dst); - OCL_CALL (clReleaseMemObject, cl_dst); + /* Save the image (for debug purpose) */ + cl_write_bmp(dst, w, h, "compiler_mandelbrot.bmp"); + + /* Compare with the golden image */ + OCL_CHECK_IMAGE(dst, w, h, "compiler_mandelbrot_ref.bmp"); } MAKE_UTEST_FROM_FUNCTION(compiler_mandelbrot); |