RadixDemo has putArgSize() method that does not build

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RadixDemo has putArgSize() method that does not build

Martin
Hi,
Congratulations for the great framework! I can have almost all demos  from the github working.
Except RadixSort that does not compile on method putArgSize.
When I replace putArgSize by putArg, as in the before mentionned sample, I got the following exception.
How should I rework the code to have this working?
Best regards,
Martin


void radixSortBlocksKeysOnlyOCL(CLBuffer<IntBuffer> keys, int nbits, int startbit, int numElements) {

        int totalBlocks = numElements / 4 / CTA_SIZE;
        int globalWorkSize = CTA_SIZE * totalBlocks;
        int localWorkSize = CTA_SIZE;
       
        ckRadixSortBlocksKeysOnly.putArg(keys).putArg(tempKeys).putArg(nbits).putArg(startbit)
        .putArg(numElements).putArg(totalBlocks).putArg(4 * CTA_SIZE * 4)
        .rewind();
        /*ckRadixSortBlocksKeysOnly.putArg(keys).putArg(tempKeys).putArg(nbits).putArg(startbit)
                                 .putArg(numElements).putArg(totalBlocks).putArgSize(4 * CTA_SIZE * 4)
                                 .rewind();*/

        queue.put1DRangeKernel(ckRadixSortBlocksKeysOnly, 0, globalWorkSize, localWorkSize);
    }



 = = = workgroup size: 128 = = =
array size: 0.131072MB; elements: 32K
Exception in thread "main" com.jogamp.opencl.CLException$CLInvalidArgValueException: error setting arg 6 to value java.nio.DirectByteBuffer[pos=0 lim=12 cap=12] of size 4 of CLKernel [id: 94677160 name: radixSortBlocksKeysOnly] [error: CL_INVALID_ARG_VALUE]
        at com.jogamp.opencl.CLException.newException(CLException.java:78)
        at com.jogamp.opencl.CLKernel.setArgument(CLKernel.java:266)
        at com.jogamp.opencl.CLKernel.setArg(CLKernel.java:186)
        at com.jogamp.opencl.CLKernel.putArg(CLKernel.java:120)
        at com.jogamp.opencl.demos.radixsort.RadixSort.radixSortBlocksKeysOnlyOCL(RadixSort.java:118)
        at com.jogamp.opencl.demos.radixsort.RadixSort.radixSortStepKeysOnly(RadixSort.java:99)
        at com.jogamp.opencl.demos.radixsort.RadixSort.radixSortKeysOnly(RadixSort.java:87)
        at com.jogamp.opencl.demos.radixsort.RadixSort.sort(RadixSort.java:75)
        at com.jogamp.opencl.demos.radixsort.RadixSortDemo.<init>(RadixSortDemo.java:83)
Reply | Threaded
Open this post in threaded view
|

Re: RadixDemo has putArgSize() method that does not build

notzed
Reply | Threaded
Open this post in threaded view
|

Re: RadixDemo has putArgSize() method that does not build

Martin
Thanks for the advice, I can build the program with that change.
However I have a weird NVidia Kernel crash and the following exception at startup:
Any clue?
Cheers,
Martin

 = = = workgroup size: 128 = = =
array size: 0.131072MB; elements: 32K
Exception in thread "main" com.jogamp.opencl.CLException$CLOutOfResourcesException: can not enqueue read-buffer: CLBuffer [id: 95302912 buffer: java.nio.DirectIntBufferU[pos=0 lim=32768 cap=32768]] with
cond.: null events: null [error: CL_OUT_OF_RESOURCES]
        at com.jogamp.opencl.CLException.newException(CLException.java:78)
        at com.jogamp.opencl.CLCommandQueue.putReadBuffer(CLCommandQueue.java:181)
        at com.jogamp.opencl.CLCommandQueue.putReadBuffer(CLCommandQueue.java:151)
        at com.jogamp.opencl.demos.radixsort.RadixSortDemo.<init>(RadixSortDemo.java:78)
        at com.jogamp.opencl.demos.radixsort.RadixSortDemo.main(RadixSortDemo.java:127)
Reply | Threaded
Open this post in threaded view
|

Re: RadixDemo has putArgSize() method that does not build

notzed

Since you mustn't be using the correct demos as your problem didn't match the code, I would suggest you use the right ones first, with the latest matching jocl (jogl 2), and so on from the front page of jogamp.org.