Package com.jogamp.opencl.llb

Examples of com.jogamp.opencl.llb.CL


    public void release() {
        if(released) {
            throw new RuntimeException("already released");
        }
        released = true;
        CL cl = CLPlatform.getLowLevelCLInterface();
        int ret = cl.clReleaseDeviceEXT(ID);
        CLException.checkForError(ret, "release failed");
    }
View Full Code Here


    public void release() {
        if(released) {
            throw new RuntimeException("already released");
        }
        released = true;
        CL cl = CLPlatform.getLowLevelCLInterface();
        int ret = cl.clReleaseDeviceEXT(ID);
        CLException.checkForError(ret, "release failed");
    }
View Full Code Here

        return createSubDevices(props)[0];
    }

    private CLSubDevice[] createSubDevices(LongBuffer props) {

        CL cl = CLPlatform.getLowLevelCLInterface();

        IntBuffer ib = Buffers.newDirectIntBuffer(1);
        int ret = cl.clCreateSubDevicesEXT(ID, props, 0, null, ib);
        CLException.checkForError(ret, "create sub devices failed");

        int count = ib.get(0);
        NativeSizeBuffer ids = NativeSizeBuffer.allocateDirect(count);
        ret = cl.clCreateSubDevicesEXT(ID, props, count, ids, null);
        CLException.checkForError(ret, "create sub devices failed");

        CLSubDevice[] devices = new CLSubDevice[count];
        for (int i = 0; i < devices.length; i++) {
            devices[i] = CLSubDevice.createSubDevice(this, ids.get());
View Full Code Here

        return deviceInfo;
    }

    private LongBuffer getInfoLongs(int flag) {

        CL cl = CLPlatform.getLowLevelCLInterface();

        NativeSizeBuffer nsb = NativeSizeBuffer.allocateDirect(1);
        int ret = cl.clGetDeviceInfo(ID, flag, 0, null, nsb);
        CLException.checkForError(ret, "clGetDeviceInfo failed");

        LongBuffer types = Buffers.newDirectByteBuffer((int)nsb.get(0)).asLongBuffer();
        ret = cl.clGetDeviceInfo(ID, flag, types.capacity()*Buffers.SIZEOF_LONG, types, null);
        CLException.checkForError(ret, "clGetDeviceInfo failed");

        return types;
    }
View Full Code Here

        return createSubDevices(props)[0];
    }

    private CLSubDevice[] createSubDevices(LongBuffer props) {

        CL cl = CLPlatform.getLowLevelCLInterface();

        IntBuffer ib = Buffers.newDirectIntBuffer(1);
        int ret = cl.clCreateSubDevicesEXT(ID, props, 0, null, ib);
        CLException.checkForError(ret, "create sub devices failed");

        int count = ib.get(0);
        NativeSizeBuffer ids = NativeSizeBuffer.allocateDirect(count);
        ret = cl.clCreateSubDevicesEXT(ID, props, count, ids, null);
        CLException.checkForError(ret, "create sub devices failed");

        CLSubDevice[] devices = new CLSubDevice[count];
        for (int i = 0; i < devices.length; i++) {
            devices[i] = CLSubDevice.createSubDevice(this, ids.get());
View Full Code Here

        return deviceInfo;
    }

    private LongBuffer getInfoLongs(int flag) {

        CL cl = CLPlatform.getLowLevelCLInterface();

        NativeSizeBuffer nsb = NativeSizeBuffer.allocateDirect(1);
        int ret = cl.clGetDeviceInfo(ID, flag, 0, null, nsb);
        CLException.checkForError(ret, "clGetDeviceInfo failed");

        LongBuffer types = Buffers.newDirectByteBuffer((int)nsb.get(0)).asLongBuffer();
        ret = cl.clGetDeviceInfo(ID, flag, types.capacity()*Buffers.SIZEOF_LONG, types, null);
        CLException.checkForError(ret, "clGetDeviceInfo failed");

        return types;
    }
View Full Code Here

    static <B extends Buffer> CLGLTexture2d<B> createFromGLTexture2d(CLContext context, B directBuffer, int target, int texture, int mipLevel, int flags) {

        CLGLBuffer.checkBuffer(directBuffer, flags);

        CL cl = getCL(context);
        int[] result = new int[1];
        CLGL clgli = (CLGL)cl;

        long id = clgli.clCreateFromGLTexture2D(context.ID, flags, target, mipLevel, texture, result, 0);
        checkForError((int)id, "can not share memory with texture #"+texture+".");
View Full Code Here

    static <B extends Buffer> CLGLTexture2d<B> createFromGLTexture2d(CLContext context, B directBuffer, int target, int texture, int mipLevel, int flags) {

        CLGLBuffer.checkBuffer(directBuffer, flags);

        CL cl = getCL(context);
        int[] result = new int[1];
        CLGL clgli = (CLGL)cl;

        long id = clgli.clCreateFromGLTexture2D(context.ID, flags, target, mipLevel, texture, result, 0);
        checkForError((int)id, "can not share memory with texture #"+texture+".");
View Full Code Here

    static <B extends Buffer> CLGLTexture3d<B> createFromGLTexture3d(CLContext context, B directBuffer, int flags, int target, int mipLevel, int texture) {

        CLGLBuffer.checkBuffer(directBuffer, flags);

        CL cl = getCL(context);
        int[] result = new int[1];
        CLGL clgli = (CLGL)cl;

        long id = clgli.clCreateFromGLTexture3D(context.ID, flags, target, mipLevel, texture, result, 0);
View Full Code Here

    static <B extends Buffer> CLGLTexture3d<B> createFromGLTexture3d(CLContext context, B directBuffer, int flags, int target, int mipLevel, int texture) {

        CLGLBuffer.checkBuffer(directBuffer, flags);

        CL cl = getCL(context);
        int[] result = new int[1];
        CLGL clgli = (CLGL)cl;

        long id = clgli.clCreateFromGLTexture3D(context.ID, flags, target, mipLevel, texture, result, 0);
View Full Code Here

TOP

Related Classes of com.jogamp.opencl.llb.CL

Copyright © 2018 www.massapicom. 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.