RadixDemo has putArgSize() method that does not build
Posted by Martin on Feb 09, 2012; 8:06am
URL: https://forum.jogamp.org/RadixDemo-has-putArgSize-method-that-does-not-build-tp3728738.html
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)