preview

Expion II : Kernel-Type Process Of The Opencl Program

Decent Essays
SECTION III: EXAMPLE OpenCL PROGRAM Using OpenCL in programming is relatively straightforward. First, write a kernel-type method in C; this is the code that will be run on a kernel. Next, identify the platform the code is running on, and the device it will execute on within that platform. Then you must instantiate a context from the device and create an instance of the kernel (this is the program). Next, send the kernel to the
The following is a very short program written in C++ that uses the OpenCL interface. Its purpose is to print the name and capabilities of the device running it, and pass a string to the “demo” kernel. The Demo kernel fills the string with “CPE 186” and passes it back.
Demo.cl
__kernel void demo(__global char*
…show more content…
Figure 3: Running the built project on the development environment
When run on the development environment, it was shown that OpenCL was run on a device called “Hawaii” (my development environment’s R9 390 graphics card) which has forty available compute units; and the string result was “CPE 186”. Figure 4: Running the built project on a laptop
When run on my laptop, it instead
    Get Access