From cc884ee71f017d9493da22565fc33e6828da123d Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Sun, 28 Jan 2018 22:26:04 +0100 Subject: Added point and click functionality --- Release/cl/mandelbrot64.cl | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) (limited to 'Release/cl/mandelbrot64.cl') diff --git a/Release/cl/mandelbrot64.cl b/Release/cl/mandelbrot64.cl index be38b4a..c89f17c 100644 --- a/Release/cl/mandelbrot64.cl +++ b/Release/cl/mandelbrot64.cl @@ -1,11 +1,15 @@ +#define native_log2 log2 +#define native_cos cos + #ifdef KHR_DP_EXTENSION #pragma OPENCL EXTENSION cl_khr_fp64 : enable #else #pragma OPENCL EXTENSION cl_amd_fp64 : enable #endif -__kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, const double posy, const double stepSizeX, const double stepSizeY, const uint maxIterations, const uint width) +__kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, const double posy, const double stepSizeX, const double stepSizeY, const uint maxIterations, const int width) { +//printf("%f, %f, %f, %f, %u, %d", posx, posy, stepSizeX, stepSizeY, maxIterations, width); int tid = get_global_id(0); int i = tid % (width / 4); @@ -162,13 +166,6 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[0].s1 = 0; color[0].s2 = 0; } - if (bench) - { - color[0].s0 = ccount.s0 & 0xff; - color[0].s1 = (ccount.s0 & 0xff00) >> 8; - color[0].s2 = (ccount.s0 & 0xff0000) >> 16; - color[0].s3 = (ccount.s0 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid] = color[0]; c = fc.s1 * 2.0 * 3.1416 / 256.0; color[1].s0 = ((1.0 + native_cos(c)) * 0.5) * 255; @@ -181,13 +178,6 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[1].s1 = 0; color[1].s2 = 0; } - if (bench) - { - color[1].s0 = ccount.s1 & 0xff; - color[1].s1 = (ccount.s1 & 0xff00) >> 8; - color[1].s2 = (ccount.s1 & 0xff0000) >> 16; - color[1].s3 = (ccount.s1 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid + 1] = color[1]; c = fc.s2 * 2.0 * 3.1416 / 256.0; color[2].s0 = ((1.0 + native_cos(c)) * 0.5) * 255; @@ -200,13 +190,6 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[2].s1 = 0; color[2].s2 = 0; } - if (bench) - { - color[2].s0 = ccount.s2 & 0xff; - color[2].s1 = (ccount.s2 & 0xff00) >> 8; - color[2].s2 = (ccount.s2 & 0xff0000) >> 16; - color[2].s3 = (ccount.s2 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid + 2] = color[2]; c = fc.s3 * 2.0 * 3.1416 / 256.0; color[3].s0 = ((1.0 + native_cos(c)) * 0.5) * 255; @@ -219,12 +202,5 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[3].s1 = 0; color[3].s2 = 0; } - if (bench) - { - color[3].s0 = ccount.s3 & 0xff; - color[3].s1 = (ccount.s3 & 0xff00) >> 8; - color[3].s2 = (ccount.s3 & 0xff0000) >> 16; - color[3].s3 = (ccount.s3 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid + 3] = color[3]; } \ No newline at end of file -- cgit v1.2.1