@@ -1641,28 +1641,28 @@ Context& initializeContextFromGL()
1641
1641
#elif !defined(HAVE_OPENCL_OPENGL_SHARING)
1642
1642
NO_OPENCL_SHARING_ERROR;
1643
1643
#else
1644
- cl_uint numPlatforms ;
1644
+ cl_uint platformsCnt ;
1645
1645
cl_uint devCnt;
1646
1646
cl_device_id* devices;
1647
1647
cl_uint devUsed;
1648
1648
cl_context context;
1649
1649
1650
- cl_int status = clGetPlatformIDs (0 , NULL , &numPlatforms );
1650
+ cl_int status = clGetPlatformIDs (0 , NULL , &platformsCnt );
1651
1651
if (status != CL_SUCCESS)
1652
1652
CV_Error_ (cv::Error::OpenCLInitError, (" OpenCL: Can't get number of platforms: %d" , status));
1653
- if (numPlatforms == 0 )
1653
+ if (platformsCnt == 0 )
1654
1654
CV_Error (cv::Error::OpenCLInitError, " OpenCL: No available platforms" );
1655
1655
1656
- std::vector<cl_platform_id> platforms (numPlatforms );
1657
- status = clGetPlatformIDs (numPlatforms , &platforms[0 ], NULL );
1656
+ std::vector<cl_platform_id> platforms (platformsCnt );
1657
+ status = clGetPlatformIDs (platformsCnt , &platforms[0 ], NULL );
1658
1658
if (status != CL_SUCCESS)
1659
1659
CV_Error_ (cv::Error::OpenCLInitError, (" OpenCL: Can't get platforms: %d" , status));
1660
1660
1661
1661
1662
1662
// TODO Filter platforms by name from OPENCV_OPENCL_DEVICE
1663
1663
bool sharingSupported = false ;
1664
1664
1665
- for (unsigned int i = 0 ; (!sharingSupported && (i < numPlatforms )); ++i) {
1665
+ for (unsigned int i = 0 ; (!sharingSupported && (i < platformsCnt )); ++i) {
1666
1666
status = clGetDeviceIDs (platforms[i], CL_DEVICE_TYPE_GPU, 0 , NULL , &devCnt);
1667
1667
if (status != CL_SUCCESS)
1668
1668
CV_Error_ (cv::Error::OpenCLInitError, (" OpenCL: No devices available: %d" , status));
0 commit comments