From 94f8ca2aa624ea96697d0fba314a661d256fb7a4 Mon Sep 17 00:00:00 2001 From: Pradeep Date: Fri, 6 Nov 2015 12:33:00 -0500 Subject: [PATCH] Fixes for opencl fractal example --- examples/opencl/fractal.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/examples/opencl/fractal.cpp b/examples/opencl/fractal.cpp index 8297c1f5..65d6da98 100644 --- a/examples/opencl/fractal.cpp +++ b/examples/opencl/fractal.cpp @@ -64,14 +64,14 @@ static const std::string fractal_ocl_kernel = "kernel\n" "void julia(global unsigned char* out, const unsigned w, const unsigned h)\n" "{\n" -" int x = get_group_id(0) * get_num_groups(0) + get_local_id(0);\n" -" int y = get_group_id(1) * get_num_groups(1) + get_local_id(1);\n" +" int x = get_group_id(0) * get_local_size(0) + get_local_id(0);\n" +" int y = get_group_id(1) * get_local_size(1) + get_local_id(1);\n" "\n" " if (x(kern); + auto juliaOp = cl::make_kernel(kern); static const NDRange local(8, 8); NDRange global(local[0] * divup(DIMX, local[0]), local[1] * divup(DIMY, local[1])); - kern.setArg(0, devOut); - kern.setArg(1, DIMX); - kern.setArg(2, DIMY); - queue.enqueueNDRangeKernel(kern, cl::NullRange, global, local); - - //juliaOp(EnqueueArgs(queue, global, local), devOut, DIMX, DIMY); + juliaOp(EnqueueArgs(queue, global, local), devOut, DIMX, DIMY); } int main(void)