|Home > Execution stages of an OpenCL application > About the execution stages > Runtime setup|
You can use the runtime API for many different operations.
The runtime API helps you to:
Create a command queue.
You must follow this sequence of commands:
Create the program object by calling either:
clBuildProgram()function to compile the program object for the specific devices on the system.
Build a program executable.
Create the kernel and memory objects:
clCreateKernel() function for each kernel, or call the
clCreateKernelsInProgram() function to create kernel
objects for all the kernels in the OpenCL application.
unmap()operations to enable the application processor to access the data.
Enqueue and execute the kernels.
Enqueue to the command queues the commands that control the sequence and synchronization of kernel execution, mapping and unmapping of memory, and manipulation of memory objects.
To execute a kernel function, you must do the following steps:
clSetKernelArg() for each parameter in the kernel function definition to
set the kernel parameter values.
Enqueue commands that make the results from the work-items available to the host.
Clean up the unused objects.