MQL4 Reference MQL5 features MQL5 functions Working with OpenCL

MQL4 Help as One File:

Working with OpenCL

OpenCL programs are used for performing computations on video cards that support OpenCL 1.1 or higher. Modern video cards contain hundreds of small specialized processors that can simultaneously perform simple mathematical operations with incoming data streams. The OpenCL language organizes parallel computing and provides greater speed for a certain class of tasks.

It is recommended to write the source code for OpenCL in separate CL files, which can later be included in the MQL5 program using the resource variables.

Function

Action

CLHandleType

Returns the type of an OpenCL handle as a value of the ENUM_OPENCL_HANDLE_TYPE enumeration

CLGetInfoInteger

Returns the value of an integer property for an OpenCL object or device

CLGetInfoString

Creates an OpenCL context

CLContextCreate

Removes an OpenCL context

CLContextFree

Receives device property from OpenCL driver

CLGetDeviceInfo

Creates an OpenCL program from a source code

CLProgramCreate

Removes an OpenCL program

CLProgramFree

Creates an OpenCL start function

CLKernelCreate

Removes an OpenCL start function

CLKernelFree

Sets a parameter for the OpenCL function

CLSetKernelArg

Sets an OpenCL buffer as a parameter of the OpenCL function

CLSetKernelArgMem

Sets the local buffer as an argument of the kernel function

CLSetKernelArgMemLocal

Creates an OpenCL buffer

CLBufferCreate

Deletes an OpenCL buffer

CLBufferFree

Writes an array into an OpenCL buffer

CLBufferWrite

Reads an OpenCL buffer into an array

CLBufferRead

Runs an OpenCL program

CLExecute

Returns the OpenCL program execution status

CLExecutionStatus

Returns the OpenCL program execution status