Package com.jogamp.common.nio

Examples of com.jogamp.common.nio.NativeSizeBuffer


            int elemSize = Buffers.sizeOfBufferElem(buffer);
            offset *= elemSize;
            size *= elemSize;
        }

        NativeSizeBuffer info = NativeSizeBuffer.allocateDirect(2);
        info.put(offset).put(size).rewind();
        int bitset = Mem.flagsToInt(flags);
       
        CLBufferBinding binding = getPlatform().getBufferBinding();
        int[] err = new int[1];
        long subID = binding.clCreateSubBuffer(ID, bitset, CL.CL_BUFFER_CREATE_TYPE_REGION, info.getBuffer(), err, 0);
        checkForError(err[0], "can not create sub buffer");

        CLSubBuffer<B> clSubBuffer = new CLSubBuffer<B>(this, offset, size, slice, subID, bitset);
        if(childs == null) {
            childs = new ArrayList<CLSubBuffer<B>>();
View Full Code Here


        binding = program.getPlatform().getKernelBinding();

        if(name == null) {
            // get function name
            NativeSizeBuffer size = NativeSizeBuffer.wrap(buffer);
            int ret = binding.clGetKernelInfo(ID, CL_KERNEL_FUNCTION_NAME, 0, null, size);
            checkForError(ret, "error while asking for kernel function name");

            ByteBuffer bb = Buffers.newDirectByteBuffer((int)size.get(0));

            ret = binding.clGetKernelInfo(ID, CL_KERNEL_FUNCTION_NAME, bb.capacity(), bb, null);
            checkForError(ret, "error while asking for kernel function name");
           
            this.name = CLUtil.clString2JavaString(bb, bb.capacity());
View Full Code Here

        // find all available OpenCL platforms
        int ret = cl.clGetPlatformIDs(0, null, ib);
        checkForError(ret, "can not enumerate platforms");

        // receive platform ids
        NativeSizeBuffer platformId = NativeSizeBuffer.allocateDirect(ib.get(0));
        ret = cl.clGetPlatformIDs(platformId.capacity(), platformId, null);
        checkForError(ret, "can not enumerate platforms");

        List<CLPlatform> platforms = new ArrayList<CLPlatform>();

        for (int i = 0; i < platformId.capacity(); i++) {
            CLPlatform platform = new CLPlatform(platformId.get(i));
            addIfAccepted(platform, platforms, filter);
        }

        return platforms.toArray(new CLPlatform[platforms.size()]);
    }
View Full Code Here

    public void waitForEvents(int start, int range) {
        if(start+range < size || range <= 0) {
            throw new IndexOutOfBoundsException("args: [start: "+start+" range: "+range+"], eventcount: "+size);
        }

        NativeSizeBuffer view = getEventBuffer(start);
        getEvent(start).getPlatform().getEventBinding().clWaitForEvents(range, view);
    }
View Full Code Here

    /**
     * Waits for the event with the given index in this list to occur.
     */
    public void waitForEvent(int index) {
        NativeSizeBuffer view = getEventBuffer(index);
        getEvent(index).getPlatform().getEventBinding().clWaitForEvents(1, view);
    }
View Full Code Here

    /**
     * Calls {@native clEnqueueWriteBuffer}.
     */
    public CLCommandQueue putWriteBuffer(CLBuffer<?> writeBuffer, boolean blockingWrite, CLEventList condition, CLEventList events) {

        NativeSizeBuffer conditionIDs = null;
        int conditions = 0;
        if(condition != null) {
            conditionIDs = condition.IDsView;
            conditions   = condition.size;
        }
View Full Code Here

    /**
     * Calls {@native clEnqueueReadBuffer}.
     */
    public CLCommandQueue putReadBuffer(CLBuffer<?> readBuffer, boolean blockingRead, CLEventList condition, CLEventList events) {

        NativeSizeBuffer conditionIDs = null;
        int conditions = 0;
        if(condition != null) {
            conditionIDs = condition.IDsView;
            conditions   = condition.size;
        }
View Full Code Here

    /**
     * Calls {@native clEnqueueCopyBuffer}.
     */
    public CLCommandQueue putCopyBuffer(CLBuffer<?> src, CLBuffer<?> dest, int srcOffset, int destOffset, long bytesToCopy, CLEventList condition, CLEventList events) {

        NativeSizeBuffer conditionIDs = null;
        int conditions = 0;
        if(condition != null) {
            conditionIDs = condition.IDsView;
            conditions   = condition.size;
        }
View Full Code Here

    public CLCommandQueue putWriteBufferRect(CLBuffer<?> writeBuffer,
            int originX, int originY, int originZ, int hostX, int hostY, int hostZ, int rangeX, int rangeY, int rangeZ,
            long rowPitch, long slicePitch, long hostRowPitch, long hostSlicePitch,
            boolean blockingWrite, CLEventList condition, CLEventList events) {

        NativeSizeBuffer conditionIDs = null;
        int conditions = 0;
        if(condition != null) {
            conditionIDs = condition.IDsView;
            conditions   = condition.size;
        }
View Full Code Here

    public CLCommandQueue putReadBufferRect(CLBuffer<?> readBuffer,
            int originX, int originY, int originZ, int hostX, int hostY, int hostZ, int rangeX, int rangeY, int rangeZ,
            long rowPitch, long slicePitch, long hostRowPitch, long hostSlicePitch,
            boolean blockingRead, CLEventList condition, CLEventList events) {

        NativeSizeBuffer conditionIDs = null;
        int conditions = 0;
        if(condition != null) {
            conditionIDs = condition.IDsView;
            conditions   = condition.size;
        }
View Full Code Here

TOP

Related Classes of com.jogamp.common.nio.NativeSizeBuffer

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.