LibreOCL/Test/OCL_TST_Exp_02.mq5

26 lines
1.6 KiB
MQL5
Raw Permalink Normal View History

2025-05-30 15:03:43 +02:00
<EFBFBD><EFBFBD>void OnStart(){
//---
int dCount=(int)CLGetInfoInteger(0,CL_DEVICE_COUNT);
Print("dCount =",dCount);
string Result;
{for(int i=0;i<dCount;i++)
{
ResetLastError();
int clCtx=CLContextCreate(i);
//int clCtx=CLContextCreate(CL_USE_ANY);
{if(clCtx==-1)
{
Print("============== DEVICE "+IntegerToString(i)+": ERROR in CLContextCreate="+IntegerToString(GetLastError())+" =================");
}else{
Print("============== DEVICE "+IntegerToString(i)+" =================");
//--- Get Info String
Result="";
CLGetInfoString(clCtx,CL_DEVICE_NAME,Result);
Print("DEVICE_NAME=",Result);
CLContextFree(clCtx);
}}//if(clCtx==-1)
}}//for(int i=0;i<dCount;i++)
}//OnInit()
//