#include <array.au3>
#include <memory.au3>
filedelete(@scriptdir & "\adlocl.log")
$dll=dllopen(@systemdir & "\opencl.dll")
$temp=dllcall($dll,"int","clGetPlatformIDs","uint",0,"ptr",0,"int*",0)
$platforms=dllstructcreate("uint platforms[" & $temp[3] & "]")
$temp=dllcall($dll,"int:stdcall","clGetPlatformIDs","uint",$temp[3],"ptr",dllstructgetptr($platforms),"ptr",0)
for $i=1 to dllstructgetsize($platforms)/4
for $j=0x0900 to 0x0904
$pbuf=dllstructcreate("char pbuf[100]")
$temp=dllcall($dll,"int:stdcall","clGetPlatformInfo","uint",dllstructgetdata($platforms,1,$i),"uint",$j,"uint",dllstructgetsize($pbuf),"ptr",dllstructgetptr($pbuf),"ptr",0)
;~ consolewrite("Platform " & $i & " information: " & dllstructgetdata($pbuf,1) & @crlf)
filewriteline(@scriptdir & "\adlocl.log","Platform " & $i & " information: " & dllstructgetdata($pbuf,1) & @crlf)
next
$devices=dllstructcreate("int device1;int device2;int device3;int device4;int device5;int device6;int device7;int device8;")
$temp=dllcall($dll,"int:stdcall","clGetDeviceIDs","uint",dllstructgetdata($platforms,1,$i),"uint64",bitshift(1,-2),"uint",4,"ptr",dllstructgetptr($devices),"ptr",0)
for $j=1 to dllstructgetsize($devices)/4
;~ if dllstructgetdata($devices,$j)<>0 then
;~ consolewrite(" Device " & $j & " number: " & dllstructgetdata($devices,$j) & @crlf)
filewriteline(@scriptdir & "\adlocl.log"," Device " & $j & " number: " & dllstructgetdata($devices,$j) & @crlf)
$deviceinfo=dllstructcreate("uint")
$temp=dllcall($dll,"int:stdcall","clGetDeviceInfo","uint",dllstructgetdata($devices,$j),"uint",0x1001,"uint",dllstructgetsize($deviceinfo),"ptr",dllstructgetptr($deviceinfo),"uint*",0)
;~ consolewrite(" Device " & $j & " vendor ID: " & dllstructgetdata($deviceinfo,1) & @crlf)
filewriteline(@scriptdir & "\adlocl.log"," Device " & $j & " vendor ID: " & dllstructgetdata($deviceinfo,1) & @crlf)
for $k=0x102b to 0x1030
$deviceinfo=dllstructcreate("char[100]")
$temp=dllcall($dll,"int:stdcall","clGetDeviceInfo","uint",dllstructgetdata($devices,$j),"uint",$k,"uint",dllstructgetsize($deviceinfo),"ptr",dllstructgetptr($deviceinfo),"uint*",0)
;~ consolewrite(" Device " & $j & " information: " & dllstructgetdata($deviceinfo,1) & @crlf)
filewriteline(@scriptdir & "\adlocl.log"," Device " & $j & " information: " & dllstructgetdata($deviceinfo,1) & @crlf)
next
;~ endif
next
next
dllclose($dll)
Copy/paste and run that. Let me know the output. It just attempts to read 8 devices without checking if device number is present.
Bug Report:
When I run the EXE file, I get an Autoit error: "Subscript used with non-Array variable".
When I run the au3 file in scite (F5), I get the following error details:
>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\aoclbf 1.74a\aoclbf\aoclbf 1.74a.au3"
C:\aoclbf 1.74a\aoclbf\aoclbf 1.74a.au3 (1870) : ==> Subscript used with non-Array variable.:
if $temp[0]=0 then
if $temp^ ERROR
->09:21:23 AutoIT3.exe ended.rc:1
>Exit code: 1 Time: 2.412
You don't have ADL DLL registered in environment variables?