ocl: fix PlatformInfo usage

pull/18429/head
Alexander Alekhin 4 years ago
parent c32e349332
commit c945ea125a
  1. 8
      modules/core/src/directx.cpp
  2. 2
      modules/core/src/ocl.cpp
  3. 2
      modules/core/src/opengl.cpp
  4. 8
      modules/core/src/va_intel.cpp

@ -459,7 +459,7 @@ Context& initializeContextFromD3D11Device(ID3D11Device* pD3D11Device)
}
cl_platform_id platform = platforms[found];
std::string platformName = PlatformInfo(platform).name();
std::string platformName = PlatformInfo(&platform).name();
OpenCLExecutionContext clExecCtx;
try
@ -579,7 +579,7 @@ Context& initializeContextFromD3D10Device(ID3D10Device* pD3D10Device)
}
cl_platform_id platform = platforms[found];
std::string platformName = PlatformInfo(platform).name();
std::string platformName = PlatformInfo(&platform).name();
OpenCLExecutionContext clExecCtx;
try
@ -701,7 +701,7 @@ Context& initializeContextFromDirect3DDevice9Ex(IDirect3DDevice9Ex* pDirect3DDev
}
cl_platform_id platform = platforms[found];
std::string platformName = PlatformInfo(platform).name();
std::string platformName = PlatformInfo(&platform).name();
OpenCLExecutionContext clExecCtx;
try
@ -824,7 +824,7 @@ Context& initializeContextFromDirect3DDevice9(IDirect3DDevice9* pDirect3DDevice9
}
cl_platform_id platform = platforms[found];
std::string platformName = PlatformInfo(platform).name();
std::string platformName = PlatformInfo(&platform).name();
OpenCLExecutionContext clExecCtx;
try

@ -3102,7 +3102,7 @@ void initializeContextFromHandle(Context& ctx, void* _platform, void* _context,
cl_context context = (cl_context)_context;
cl_device_id deviceID = (cl_device_id)_device;
std::string platformName = PlatformInfo(platformID).name();
std::string platformName = PlatformInfo(&platformID).name();
auto clExecCtx = OpenCLExecutionContext::create(platformName, platformID, context, deviceID);
CV_Assert(!clExecCtx.empty());

@ -1690,7 +1690,7 @@ Context& initializeContextFromGL()
CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't create context for OpenGL interop");
cl_platform_id platform = platforms[found];
std::string platformName = PlatformInfo(platform).name();
std::string platformName = PlatformInfo(&platform).name();
OpenCLExecutionContext clExecCtx = OpenCLExecutionContext::create(platformName, platform, context, device);
clReleaseDevice(device);

@ -141,13 +141,7 @@ Context& initializeContextFromVA(VADisplay display, bool tryInterop)
contextInitialized = true;
cl_platform_id platform = platforms[found];
char platformName[1024] = {0};
size_t sz = 0;
if (clGetPlatformInfo(platform, CL_PLATFORM_NAME, sizeof(platformName) - 16, platformName, &sz) != CL_SUCCESS
|| sz >= sizeof(platformName))
{
CV_Error(cv::Error::OpenCLInitError, "OpenCL: Failed to get platform name");
}
std::string platformName = PlatformInfo(&platform).name();
OpenCLExecutionContext clExecCtx;
try

Loading…
Cancel
Save