Repository navigation
FIX: getting platformIDs in initializeContextFromD3D11Device - #14376
Conversation
|
/cc @Mainvooid Could you take a look on this patch? |
|
This is not a bug, but the error message in line 269 is wrong. opencv/modules/core/src/directx.cpp Line 269 in 5c0a98c
|
|
@Mainvooid Really? I think that opencv/modules/core/src/directx.cpp Line 267 in 5c0a98c In fact, samples/directx/d3d11_interop.cpp does not work property in my environment (OpenCL device No.0=Intel & No.1=NVIDIA, but primary DirectX device is NVIDIA), but it works correctly with my modified. I think that your code does not specify platform index for clGetPlatformIDs in a for loop, and cannot specify platform index in |
| #endif | ||
| for (int i = 0; i < (int)numPlatforms; i++) | ||
| { | ||
| status = clGetPlatformIDs(numPlatforms, &platforms[i], NULL); |
There was a problem hiding this comment.
&platforms[i]
Memory corruption was here if numPlatforms > 1
|
@masa-iwm status = clGetPlatformIDs(numPlatforms, &platforms[0], NULL);
if (status != CL_SUCCESS)
CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't get platforms");After this change, we can get a list of OCL platforms found outside the for loop and then check required extensions for each platform within the for loop. |
* fix getting platformIDs in initializeContextFromD3D11Device
This pullrequest changes
relates #13972
fix usage of clGetPlatformIDs in initializeContextFromD3D11Device