/** * Calls <a href="http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateContext.html">clCreateContext</a>.<br> */ @Deprecated public CLContext createGLCompatibleContext(CLDevice... devices) { for (CLDevice device : devices) { if (!device.isGLSharingSupported()) continue; try { return createContext(getGLContextProperties(this), device); } catch (Throwable th) {} } throw new UnsupportedOperationException("Failed to create an OpenGL-sharing-enabled OpenCL context out of devices " + Arrays.asList(devices)); }
/** * Calls <a href="http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clCreateContext.html">clCreateContext</a>.<br> */ @Deprecated public CLContext createGLCompatibleContext(CLDevice... devices) { for (CLDevice device : devices) { if (!device.isGLSharingSupported()) continue; try { return createContext(getGLContextProperties(this), device); } catch (Throwable th) {} } throw new UnsupportedOperationException("Failed to create an OpenGL-sharing-enabled OpenCL context out of devices " + Arrays.asList(devices)); }
@Deprecated public CLDevice guessCurrentGLDevice() { long[] props = platform.getContextProps(CLPlatform.getGLContextProperties(getPlatform())); Pointer<SizeT> propsRef = pointerToSizeTs(props); Pointer<SizeT> pCount = allocateSizeT(); Pointer<Pointer<?>> mem = allocatePointer(); if (Platform.isMacOSX()) error(CL.clGetGLContextInfoAPPLE( getEntity(), getPeer(OpenGLContextUtils.CGLGetCurrentContext()), CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR, Pointer.SIZE, getPeer(mem), getPeer(pCount))); else error(CL.clGetGLContextInfoKHR( getPeer(propsRef), CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR, Pointer.SIZE, getPeer(mem), getPeer(pCount) )); if (pCount.getSizeT() != Pointer.SIZE) throw new RuntimeException("Not a device : len = " + pCount.get().intValue()); Pointer p = mem.getPointer(); if (p.equals(Pointer.NULL)) return null; return new CLDevice(null, getPeer(p)); }
@Deprecated public CLDevice guessCurrentGLDevice() { long[] props = platform.getContextProps(CLPlatform.getGLContextProperties(getPlatform())); Pointer<SizeT> propsRef = pointerToSizeTs(props); Pointer<SizeT> pCount = allocateSizeT(); Pointer<Pointer<?>> mem = allocatePointer(); if (Platform.isMacOSX()) error(CL.clGetGLContextInfoAPPLE( getEntity(), getPeer(OpenGLContextUtils.CGLGetCurrentContext()), CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR, Pointer.SIZE, getPeer(mem), getPeer(pCount))); else error(CL.clGetGLContextInfoKHR( getPeer(propsRef), CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR, Pointer.SIZE, getPeer(mem), getPeer(pCount) )); if (pCount.getSizeT() != Pointer.SIZE) throw new RuntimeException("Not a device : len = " + pCount.get().intValue()); Pointer p = mem.getPointer(); if (p.equals(Pointer.NULL)) return null; return new CLDevice(null, getPeer(p)); }