ScalerByLeo/Test/Benchmark.mq5

54 lines
1.9 KiB
MQL5
Raw Permalink Normal View History

2025-12-23 12:36:39 -05:00
//+------------------------------------------------------------------+
//| Benchmark.mq5 |
//| Copyright 2025, Niquel Mendoza. |
//| https://www.mql5.com/es/users/nique_372/news |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Niquel Mendoza."
#property link "https://www.mql5.com/es/users/nique_372/news"
#property version "1.00"
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
2025-12-23 16:00:49 -05:00
#include "..\\Src\\ScalerBaseCL.mqh"
#include "..\\Src\\ScalerBase.mqh"
2025-12-23 12:36:39 -05:00
#define COLS 16000
#define ROWS 16000
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnStart()
{
//---
matrix hola;
hola.Resize(ROWS, COLS);
hola.Random(0, 20.0);
//---
MaxMinScalerCL<uint> escalador;
ulong antes = GetMicrosecondCount();
escalador.fit_transform(hola, false);
ulong despues = GetMicrosecondCount() - antes;
Print("Tiempo en microsegundos GPU = ", despues);
Sleep(1000);
//---
MaxMinScaler escalador_n;
antes = GetMicrosecondCount();
escalador_n.fit_transform(hola, false);
despues = GetMicrosecondCount() - antes;
Print("Tiempo en microsegundos CPU = ", despues);
//--- Ouput
/*
2025.12.23 11:39:12.875 Benchmark (XAUUSD,M1) OpenCL: GPU device 'Iceland' selected
2025.12.23 11:39:20.506 Benchmark (XAUUSD,M1) Tiempo en microsegundos GPU = 7013641
2025.12.23 11:39:50.290 Benchmark (XAUUSD,M1) Tiempo en microsegundos CPU = 28766984
*/
}
//+------------------------------------------------------------------+