clpeak use ctx.getInfo() interface to get devices.
It will call OpenCL C API clCreateContextFromType eventually.
There is a description about clCreateContextFromType in OpenCL specification "clCreateContextFromType may return all or a subset of the actual physical devices present in the platform and that match device_type."
So on some platform, this method can't get all the devices.
There is another interface platform.getDevices() which also can get devices.
It will call OpenCL C API clGetDeviceIDs eventually.
Actually, clGetDeviceIDs also has similar description in the specification "clGetDeviceIDs may return all or a subset of the actual physical devices present in the platform and that match device_type."
We don't know which interface can return more devices on different platform.
So my idea is: we can call these two interfaces and use the one which returns more devices to get better compatibility.
Here is the patch I worked out clpeak_diff.txt
Can you give some suggestion for this issue and do you think this solution is acceptable?
Hi,
clpeak use ctx.getInfo() interface to get devices.
It will call OpenCL C API clCreateContextFromType eventually.
There is a description about clCreateContextFromType in OpenCL specification "clCreateContextFromType may return all or a subset of the actual physical devices present in the platform and that match device_type."
So on some platform, this method can't get all the devices.
There is another interface platform.getDevices() which also can get devices. It will call OpenCL C API clGetDeviceIDs eventually. Actually, clGetDeviceIDs also has similar description in the specification "clGetDeviceIDs may return all or a subset of the actual physical devices present in the platform and that match device_type."
We don't know which interface can return more devices on different platform. So my idea is: we can call these two interfaces and use the one which returns more devices to get better compatibility.
Here is the patch I worked out clpeak_diff.txt Can you give some suggestion for this issue and do you think this solution is acceptable?