openCL platform/device query
By : Moritz S
Date : March 29 2020, 07:55 AM
|
In OpenCL, what is the difference between platform, context, and device?
By : Rooman Kornov
Date : March 29 2020, 07:55 AM
wish helps you A platform is a specific OpenCL implementation, for instance AMD APP, NVIDIA or Intel OpenCL. A context is a platform with a set of available devices for that platform. And the devices are the actual processors (CPU, GPU etc.) that perform calculations. So if you use the Intel platform, a valid context with this platform would include a CPU device. While if you use the NVIDIA platform, a valid context would include an NVIDIA GPU device.
|
OpenCL - C++ wrapper - Context deinitialization in dynamic library leads to access violation
By : I cant delete my pro
Date : March 29 2020, 07:55 AM
Any of those help There's a potential for an very subtle issue if you try to release an OpenCL object from a DllMain. It can show the behavior you are seeing, but can be somewhat unpredictable or intermittent. First, a little background: When you load OpenCL.dll, on most platforms you are loading a standardized Installable Client Driver (ICD) that is a shim between your code and the various implementations that might exist on your system. You can read more about it here. The ICD is a DLL that uses the Windows LoadLibrary call to load the DLLs provided by the OpenCL vendor (Intel, AMD, etc.).
|
SDL- get HDC device context for OpenGL/OpenCL shared context
By : pkamat
Date : March 29 2020, 07:55 AM
around this issue The most portable and framework agnostic method is to use the platform specific WSI functions to query the drawable and OpenGL context. Using a few typedefs you can make portable wrappers which you can then use to query the context and drawable. code :
#if defined(_WIN32)
typedef HGLRC GLContext;
typedef HDC GLDrawable;
typedef HWND GLWindow;
GLContext getCurrentGLContext(void) { return wglGetCurrentContext(); }
GLDrawable getCurrentGLDrawable(void) { return wglGetCurrentDC(); }
GLWindow getCurrentGLWindow(void) { return WindowFromDC(wglGetCurrentDC()); }
#elif defined(__unix__)
/* FIXME: consider Wayland or a EGL environment */
typedef GLXContext GLContext;
typedef GLXDrawable GLDrawable;
typedef Window GLWindow;
GLContext getCurrentGLContext(void) { return glXGetCurrentContext(); }
GLDrawable getCurrentGLDrawable(void) { return glXGetCurrentDrawable(); }
GLWindow getCurrentGLWindow(void) { return glXGetCurrentDrawable(); }
#elif __APPLE__
/* FIXME: Implement this for MacOS X
#endif
|
OpenCL only one device in a platform
By : JB Mike John-Baptist
Date : March 29 2020, 07:55 AM
|