26 lines
No EOL
1.6 KiB
MQL5
26 lines
No EOL
1.6 KiB
MQL5
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()
|
|
//
|
|
|