Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17255 Discussions

Wrong behavior of clGetPlatformIDs()

Altera_Forum
Honored Contributor II
1,456 Views

Hi all, 

 

I discovered that calling the function cl_int clgetplatformids (cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms) with the platforms parameter set to NULL and the num_entries different from zero I get a CL_INVALID_VALUE error return value. Follows an example of the code used: 

cl_uint err, platformCount; // get platform counter err = clGetPlatformIDs (1, NULL, &platformCount); if (err != CL_SUCCESS) { printf("ERROR %s\n", getErrorString(err)); exit(err); }  

 

This should not happened because as defined from the standard: (https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clgetplatformids.html

 

--- Quote Start ---  

Errors: 

Returns CL_SUCCESS if the function is executed successfully. Otherwise it returns CL_INVALID_VALUE if num_entries is equal to zero and platforms is not NULL, or if both num_platforms and platforms are NULL. 

--- Quote End ---  

 

 

Is it wanted from Altera or is it a bug in the implementation? :confused: 

 

p.s: If I use clGetPlatformIDs (0, NULL, &platformCount) works perfectly.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
690 Views

Indeed you seem to have found a bug since per the OpenCL 1.0 specification: "the number of OpenCL platforms returned is the mininum of the value specified by num_entries or the number of OpenCL platforms available." Would you please file an service request (SR) with you myAltera account, including the code snippet you provided, to make sure this gets routed to the right people within Altera.

0 Kudos
Altera_Forum
Honored Contributor II
690 Views

Just opened a service request. I will update the post as soon as I have news.

0 Kudos
Reply