MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading Language Documentation

Subscribe to signal
FxProHM
315.59%, 40 020.73 USD
Screenshot
XAUUSD, M15
Real
RSI on Realtime DealsRSI on Realtime Deals Try product
RSI on Realtime Deals
Author: song_song
MQL5 Programming Basics: Time MQL5 Programming Basics: Time GetLotForOpeningPos Library
GetLotForOpeningPos
Author: GODZILLA

CLExecute

The function runs an OpenCL program. There are 3 versions of the function:

1. Launching kernel functions using one kernel

bool  CLExecute(
   int          kernel                    // Handle to the kernel of an OpenCL program
   );

2. Launching several kernel copies (OpenCL function) with task space description

bool  CLExecute(
   int          kernel,                   // Handle to the kernel of an OpenCL program
   uint         work_dim,                 // Dimension of the tasks space
   const uint&  global_work_offset[],     // Initial offset in the tasks space
   const uint&  global_work_size[]        // Total number of tasks
   );

3. Launching several kernel copies (OpenCL function) with task space description and specification of the size of the group's local task subset

bool  CLExecute(
   int          kernel,                   // Handle to the kernel of an OpenCL program
   uint         work_dim,                 // Dimension of the tasks space
   const uint&  global_work_offset[],     // Initial offset in the tasks space
   const uint&  global_work_size[],       // Total number of tasks
   const uint&  local_work_size[]         // Number of tasks in the local group
   );

Parameters

kernel

[in]  Handle to the OpenCL kernel.

work_dim

[in]  Dimension of the tasks space.

global_work_offset[]

[in]  Initial offset in the tasks space.

global_work_size[]

[in]  The size of a subset of tasks.

local_work_size[]

[in]  The size of the group's local task subset.

Return Value

Returns true if successful, otherwise returns false. For information about the error, use the GetLastError() function.

Note

Consider the use of the parameters in the following example:

work_dim specifies work_items[] array dimension describing the tasks. If work_dim=3, three-dimensional array work_items[N1, N2, N3] is used.

global_work_size[] contains the values setting work_items[] array size. If work_dim=3, global_work_size[3] array can be {40, 100, 320}. Then we have work_items[40, 100, 320]. So, the total number of tasks is 40 х 100 х 320 = 1 280 000.

local_work_size[] sets the subset of the tasks that will be executed by the specified kernel of OpenCL program. Its dimension is equal to work_items[] dimension and allows exact division of the common task subset into smaller subsets. In fact, the sizes of local_work_size[] array should be selected so that to divide work_items[] global task set into smaller subsets. local_work_size[3]={10, 10, 10} will fit the current example, as work_items[40, 100, 320] can be gathered from local_items[10, 10, 10] array with no excess.


Updated: 2013.02.01