0
$\begingroup$

I was using Metatrader5 and have designed a strategy for trading using MQL5 programming language.
While I was running a Strategy Optimization process, I saw the it will need 10,00= iterations or possibilities. My CPU core were not capable of processing it faster. So I thought of why not to have GPU cores. i have GTX Titan Xp which has almost 4000 CUDA Cores.
But the optimization only works with CPU cores.
Hence, thought of whether it is possible to make the CUDA core to act like a CPU core for the optimization. But I could not get any way out. I tried using OpenCL which supported in the MQL5. But all my effort are wasted.
Hence, need help to convert the GPU to CPU for temporary purpose, o that the process get executed effortlessly and my CPU-GPU combinedly can be helpful.

Please help me.

$\endgroup$
  • 3
    $\begingroup$ GPU programming generally require specific programming languages or paradigms (CUDA, OpenCL, OpenACC, etc.). Consequently, you cannot "convert" CUDA cores into CPU cores, the software must be designed specifically for the use of GPUs. It is really not a straightforward process because the programming challenges are also not the same. $\endgroup$ – BlaB May 8 '18 at 12:12
  • 1
    $\begingroup$ Anton Menshov gave you the answer. I only add a comment. The fist thing to keep in mind is that not all the problems (you can read programs) can be used in parallel (over a gpu). There are many reason: the algorithm in intrinsically sequential, memory transfer not suited for gpu... So many time the gpu version can be more slow... Generally when you see a language or a program thah permit you to switch with easy between cpu and gpu is because behind the scene there is gpu code. In my opinion nowdays there are not compiler so clever to do what you search in autonomy, maybe in future years $\endgroup$ – Mauro Vanzetto May 9 '18 at 8:47
4
$\begingroup$

I assume, that you have a code that works on a standard CPU. I am not particularly familiar with MQL and Metatrader, but I don't think the answer will be different.

For compilable languages, the compiler creates an executable that is tailored to use the computational resources available to it for a given architecture (or many architectures). CPUs and GPUs are very different, and the computing cores in them offer different sets of instructions. So, without actually coding specifically for GPUs (or using a library that already provides the GPU acceleration for certain functions), I don't think you can take advantage of your GPU cores.

There are several ways to code for GPUs, you might be interested in OpenCL as it is featured on the MQL5 website with a description of what to do.

$\endgroup$
  • $\begingroup$ I did gave a try to OpenCL, is has negligible effect on the complete execution. Hence, I was looking for something that I asked in the question $\endgroup$ – Jaffer Wilson May 9 '18 at 3:56
  • 1
    $\begingroup$ @JafferWilson I understand. Unfortunately, I don't think what you are looking for exists or could currently exist (in any even slightly efficient implementation). $\endgroup$ – Anton Menshov May 9 '18 at 3:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.