Examples of CLContextBinding


Examples of com.jogamp.opencl.llb.CLContextBinding

    }

    protected static long createContextFromType(CLPlatform platform, CLErrorHandler handler, NativeSizeBuffer properties, long deviceType) {

        IntBuffer status = newDirectIntBuffer(1);
        CLContextBinding cl = platform.getContextBinding();
        long context = cl.clCreateContextFromType(properties, deviceType, handler, status);

        checkForError(status.get(), "can not create CL context");

        return context;
    }
View Full Code Here

Examples of com.jogamp.opencl.llb.CLContextBinding

                    throw new IllegalArgumentException("device at index "+i+" was null.");
                }
                pb.put(i, device.ID);
            }
        }
        CLContextBinding cl = platform.getContextBinding();
        long context = cl.clCreateContext(properties, pb, handler, status);

        checkForError(status.get(), "can not create CL context");

        return context;
    }
View Full Code Here

Examples of com.jogamp.opencl.llb.CLContextBinding

        device.setContext(this);
    }

    private CLImageFormat[] getSupportedImageFormats(int flags, int type) {

        CLContextBinding binding = platform.getContextBinding();

        int[] entries = new int[1];
        int ret = binding.clGetSupportedImageFormats(ID, flags, type, 0, null, entries, 0);
        if(ret != CL_SUCCESS) {
            throw newException(ret, "error calling clGetSupportedImageFormats");
        }

        int count = entries[0];
        if(count == 0) {
            return new CLImageFormat[0];
        }

        CLImageFormat[] formats = new CLImageFormat[count];
        CLImageFormatImpl impl = CLImageFormatImpl.create(newDirectByteBuffer(count * CLImageFormatImpl.size()));
        ret = binding.clGetSupportedImageFormats(ID, flags, type, count, impl, null);
        if(ret != CL_SUCCESS) {
            throw newException(ret, "error calling clGetSupportedImageFormats");
        }

        ByteBuffer buffer = impl.getBuffer();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.