//+------------------------------------------------------------------+ //| BitonicSort.mq5 | //| Copyright 2000-2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2000-2025, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" //--- COpenCL class #include #resource "Kernels/bitonicsort.cl" as string cl_program //+------------------------------------------------------------------+ //| QuickSortAscending | //+------------------------------------------------------------------+ //| The function sorts array[] QuickSort algorithm. | //| | //| Arguments: | //| array : Array with values to sort | //| first : First element index | //| last : Last element index | //| | //| Return value: None | //+------------------------------------------------------------------+ void QuickSortAscending(double &array[],int first,int last) { int i,j; double p_double,t_double; if(first<0 || last<0) return; i=first; j=last; while(i>1]; while(ip_double) { if(j==0) break; j--; } if(i<=j) { //-- swap elements i and j t_double=array[i]; array[i]=array[j]; array[j]=t_double; i++; if(j==0) break; j--; } } if(first>1; //--- uint passes_total=0; uint stages_total=0; //--- for(uint temp=data_count; temp>1; temp>>=1) stages_total++; //--- GPU calculation start time_gpu=GetMicrosecondCount(); for(uint stage=0; stage