MCPcopy Create free account
hub / github.com/arrayfire/forge / kernel

Function kernel

examples/opencl/fractal.cpp:85–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void kernel(cl::Buffer& devOut, cl::CommandQueue& queue)
86{
87 static std::once_flag compileFlag;
88 static cl::Program prog;
89 static cl::Kernel kern;
90
91 std::call_once(compileFlag,
92 [queue]() {
93 prog = cl::Program(queue.getInfo<CL_QUEUE_CONTEXT>(), fractal_ocl_kernel, true);
94 kern = cl::Kernel(prog, "julia");
95 });
96
97 auto juliaOp = cl::KernelFunctor<Buffer, unsigned, unsigned>(kern);
98
99 static const NDRange local(8, 8);
100 NDRange global(local[0] * divup(DIMX, (int)(local[0])),
101 local[1] * divup(DIMY, (int)(local[1])));
102
103 juliaOp(EnqueueArgs(queue, global, local), devOut, DIMX, DIMY);
104}
105
106int main(void)
107{

Callers 1

mainFunction · 0.70

Calls 1

divupFunction · 0.70

Tested by

no test coverage detected