Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the point of __ in OpenCL kernels?

Tags:

opencl

So let's say I have two OCL kernels:

__kernel void vdotprod(
 __global int* x,
 __global int* y,
 __global int* z,
 __global int* d,
 const int npoints)

and

kernel void vdotprod(
 global int* x,
 global int* y,
 global int* z,
 global int* d,
 const int npoints)

Assuming all other aspects of code are the same (incl host code and all), does the __ affect anything? What is the purpose of the __?

like image 296
jiuwo Avatar asked Jun 14 '16 08:06

jiuwo


People also ask

What is work item in OpenCL?

Work-items Each work-item in OpenCL is a thread in terms of its control flow, and its memory model. The hardware may run multiple work-items on a single thread, and you can easily picture this by imagining four OpenCL work-items operating on the separate lanes of an SSE vector.

What is workgroup size?

What is "work group" size in SYCL and how does it impact performance? A "work group" is a 1, 2 or 3 dimensional set of threads within the thread hierarchy and contains a set of "work items," and each of these work items maps to a "core" in a GPU.

What is Houdini OpenCL?

The OpenCL SOP provides a general interface to create and run OpenCL kernels on geometry. It allows binding of constants, attributes, and volume data to OpenCL parameters in the kernel.


1 Answers

The double underscore prefix does not affect the semantics of your OpenCL program.

All OpenCL specific keywords can optionally use a double underscore prefix. Use of this prefix is entirely down to programmer preference. For example, some people prefer to use the underscores as it emphasis where OpenCL extends the standard C99 language. Others prefer to omit them for brevity.

like image 87
jprice Avatar answered Oct 19 '22 05:10

jprice