| Home | Libraries | People | FAQ | More

## Porting Guide

### OpenCL API

Table 1.1. OpenCL API Translation Table

OpenCL Function | Boost.Compute Function
--- | ---
Buffers |
`clCreateBuffer()` | `buffer::buffer()`
`clReleaseMemObject()` | `buffer::~buffer()`
`clGetMemObjectInfo()` | `buffer::get_info<T>()`
Command Queues |
`clCreateCommandQueue()` | `command_queue::command_queue()`
`clReleaseCommandQueue()` | `command_queue::~command_queue()`
`clGetCommandQueueInfo()` | `command_queue::get_info<T>()`
`clEnqueueReadBuffer()` | `command_queue::enqueue_read_buffer()`
`clEnqueueWriteBuffer()` | `command_queue::enqueue_write_buffer()`
`clEnqueueCopyBuffer()` | `command_queue::enqueue_copy_buffer()`
`clEnqueueNDRangeKernel()` | `command_queue::enqueue_nd_range_kernel()`
`clEnqueueTask()` | `command_queue::enqueue_task()`
`clEnqueueBarrier()` | `command_queue::enqueue_barrier()`
`clEnqueueMarker()` | `command_queue::enqueue_marker()`
`clFlush()` | `command_queue::flush()`
`clFinish()` | `command_queue::finish()`
Contexts |
`clCreateContext()` | `context::context()`
`clReleaseContext()` | `context::~context()`
`clGetContextInfo()` | `context::get_info<T>()`
Devices |
`clGetDeviceInfo()` | `device::get_info<T>()`
Events |
`clReleaseEvent()` | `event::~event()`
`clGetEventInfo()` | `event::get_info<T>()`
`clGetEventProfilingInfo()` | `event::get_profiling_info<T>()`
`clWaitForEvents()` | `wait_list::wait()`
`clCreateUserEvent()` | `user_event::user_event()`
`clSetUserEventStatus()` | `user_event::set_status()`
Kernels |
`clCreateKernel()` | `kernel::kernel()`
`clReleaseKernel()` | `kernel::~kernel()`
`clGetKernelInfo()` | `kernel::get_info<T>()`
`clGetKernelArgInfo()` | `kernel::get_arg_info<T>()`
`clGetKernelWorkGroupInfo()` | `kernel::get_work_group_info<T>()`
`clSetKernelArg()` | `kernel::set_arg()`
`clSetKernelExecInfo()` | `kernel::set_exec_info()`
Pipes |
`clCreatePipe()` | `pipe::pipe()`
`clGetPipeInfo()` | `pipe::get_info<T>()`
Platforms |
`clGetDeviceIDs()` | `platform::devices()`
`clGetPlatformInfo()` | `platform::get_info<T>()`
`clGetExtensionFunctionAddress()` | `platform::get_extension_function_address()`
`clUnloadCompiler()` | `platform::unload_compiler()`
Programs |
`clCreateProgramWithSource()` | `program::create_with_source()`
`clCreateProgramWithBinary()` | `program::create_with_binary()`
`clCreateProgramWithBuiltInKernels()` | `program::create_with_builtin_kernels()`
`clReleaseProgram()` | `program::~program()`
`clGetProgramInfo()` | `program::get_info<T>()`
`clBuildProgram()` | `program::build()`
`clCompileProgram()` | `program::compile()`
`clLinkProgram()` | `program::link()`
Shared Virtual Memory |
`clSVMAlloc()` | `svm_alloc<T>()`
`clSVMFree()` | `svm_free<T>()`
`clEnqueueSVMFree()` | `command_queue::enqueue_svm_free()`
`clEnqueueSVMMemcpy()` | `command_queue::enqueue_svm_memcpy()`
`clEnqueueSVMMemFill()` | `command_queue::enqueue_svm_fill()`
`clEnqueueSVMMap()` | `command_queue::enqueue_svm_map()`
`clEnqueueSVMUnmap()` | `command_queue::enqueue_svm_unmap()`
System |
`clGetPlatformIDs()` | `system::platforms()`
OpenGL Sharing |
`clCreateFromGLBuffer()` | `opengl_buffer::opengl_buffer()`
`clCreateFromGLRenderbuffer()` | `opengl_renderbuffer::opengl_renderbuffer()`
`clCreateFromGLTexture()` | `opengl_texture::opengl_texture()`
`clGetGLTextureInfo()` | `opengl_texture::get_texture_info<T>()`
`clEnqueueAcquireGLObjects()` | `opengl_enqueue_acquire_gl_objects()`
`clEnqueueReleaseGLObjects()` | `opengl_enqueue_release_gl_objects()`