mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 11:40:44 +08:00
Merge pull request #18429 from alalek:ocl_fix_platforminfo
This commit is contained in:
commit
e7f2af5fdb
@ -459,7 +459,7 @@ Context& initializeContextFromD3D11Device(ID3D11Device* pD3D11Device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cl_platform_id platform = platforms[found];
|
cl_platform_id platform = platforms[found];
|
||||||
std::string platformName = PlatformInfo(platform).name();
|
std::string platformName = PlatformInfo(&platform).name();
|
||||||
|
|
||||||
OpenCLExecutionContext clExecCtx;
|
OpenCLExecutionContext clExecCtx;
|
||||||
try
|
try
|
||||||
@ -579,7 +579,7 @@ Context& initializeContextFromD3D10Device(ID3D10Device* pD3D10Device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cl_platform_id platform = platforms[found];
|
cl_platform_id platform = platforms[found];
|
||||||
std::string platformName = PlatformInfo(platform).name();
|
std::string platformName = PlatformInfo(&platform).name();
|
||||||
|
|
||||||
OpenCLExecutionContext clExecCtx;
|
OpenCLExecutionContext clExecCtx;
|
||||||
try
|
try
|
||||||
@ -701,7 +701,7 @@ Context& initializeContextFromDirect3DDevice9Ex(IDirect3DDevice9Ex* pDirect3DDev
|
|||||||
}
|
}
|
||||||
|
|
||||||
cl_platform_id platform = platforms[found];
|
cl_platform_id platform = platforms[found];
|
||||||
std::string platformName = PlatformInfo(platform).name();
|
std::string platformName = PlatformInfo(&platform).name();
|
||||||
|
|
||||||
OpenCLExecutionContext clExecCtx;
|
OpenCLExecutionContext clExecCtx;
|
||||||
try
|
try
|
||||||
@ -824,7 +824,7 @@ Context& initializeContextFromDirect3DDevice9(IDirect3DDevice9* pDirect3DDevice9
|
|||||||
}
|
}
|
||||||
|
|
||||||
cl_platform_id platform = platforms[found];
|
cl_platform_id platform = platforms[found];
|
||||||
std::string platformName = PlatformInfo(platform).name();
|
std::string platformName = PlatformInfo(&platform).name();
|
||||||
|
|
||||||
OpenCLExecutionContext clExecCtx;
|
OpenCLExecutionContext clExecCtx;
|
||||||
try
|
try
|
||||||
|
@ -3102,7 +3102,7 @@ void initializeContextFromHandle(Context& ctx, void* _platform, void* _context,
|
|||||||
cl_context context = (cl_context)_context;
|
cl_context context = (cl_context)_context;
|
||||||
cl_device_id deviceID = (cl_device_id)_device;
|
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);
|
auto clExecCtx = OpenCLExecutionContext::create(platformName, platformID, context, deviceID);
|
||||||
CV_Assert(!clExecCtx.empty());
|
CV_Assert(!clExecCtx.empty());
|
||||||
|
@ -1690,7 +1690,7 @@ Context& initializeContextFromGL()
|
|||||||
CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't create context for OpenGL interop");
|
CV_Error(cv::Error::OpenCLInitError, "OpenCL: Can't create context for OpenGL interop");
|
||||||
|
|
||||||
cl_platform_id platform = platforms[found];
|
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);
|
OpenCLExecutionContext clExecCtx = OpenCLExecutionContext::create(platformName, platform, context, device);
|
||||||
clReleaseDevice(device);
|
clReleaseDevice(device);
|
||||||
|
@ -141,13 +141,7 @@ Context& initializeContextFromVA(VADisplay display, bool tryInterop)
|
|||||||
contextInitialized = true;
|
contextInitialized = true;
|
||||||
|
|
||||||
cl_platform_id platform = platforms[found];
|
cl_platform_id platform = platforms[found];
|
||||||
char platformName[1024] = {0};
|
std::string platformName = PlatformInfo(&platform).name();
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenCLExecutionContext clExecCtx;
|
OpenCLExecutionContext clExecCtx;
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user