OpenCL: a bridge to the parallel world
J519LEE 2021-08-09 18:58:55

brief introduction

This article is about OpenCL Or the first in a series of short publications on open computing language programming . In providing for OpenCL Before support , In its current form MetaTrader 5 The platform does not allow direct access ( That is, in a native way ) Enjoy the advantages of multi-core processor to accelerate Computing .

obviously , Developers can always repeat ” This terminal is multithreaded “ as well as “ Every EA/ Scripts run in separate threads ”, However, coders do not have the opportunity to execute the following simple loops relatively simply in parallel ( A calculation pi value = 3.14159265... Code for ):

long num_steps = 1000000000;
double step = 1.0 / num_steps;
double x, pi, sum = 0.0;
for (long i = 0; i<num_steps; i++)
   x = (i + 0.5)*step;
   sum += 4.0/(1.0 + x*x);
pi = sum*step;

However , As early as 18 Months ago , stay "Articles" There is an article named 《MetaTrader 5 Parallel computing in 》 Interesting articles published . however , This article gives the impression that : Although the method is exquisitely designed , But it's a little unnatural - The whole program hierarchy written to speed up the operation in the above loop (EA Trading and two indicators ) It may backfire .

We already know There is no support for OpenMP My plan

Please bring the original link to reprint ,thank
Similar articles