Hello,
I am new to OpenCL and Jogamp. My problem is that when I try to change the size of the array in the examples BitonicSort and RadixSortDemo I always get an exception. In BitonicSort if I change the following line of code from: "final int elements = 1048576;" to: "final int elements = 1048578;" I get the following exception: Exception in thread "main" com.jogamp.opencl.CLException $ CLInvalidWorkGroupSizeException: can not enqueue 1DRange CLKernel [id: 1813676488 name: bitonicSortLocal1] with gwo: null GWS: 524289} {lws: {512} cond.: null events: null [error: CL_INVALID_WORK_GROUP_SIZE] at com.jogamp.opencl.CLException.newException (CLException.java: 78) at com.jogamp.opencl.CLCommandQueue.putNDRangeKernel (CLCommandQueue.java: 1547) at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel (CLCommandQueue.java: 1455) at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel (CLCommandQueue.java: 1425) at com.jogamp.opencl.demos.bitonicsort.BitonicSort.bitonicSort (BitonicSort.java: 161) at com.jogamp.opencl.demos.bitonicsort.BitonicSort. <init> (BitonicSort.java: 73) at com.jogamp.opencl.demos.bitonicsort.BitonicSort.main (BitonicSort.java: 204) In RadixSortDemo if I change the following line of code: from: "int [] runs = new int [] {32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608}; " to: " int [] runs = new int [] {32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388606}; " I get the following exception: Exception in thread "main" java.lang.RuntimeException at com.jogamp.opencl.demos.radixsort.Scan.scanExclusiveLarge (Scan.java: 61) at com.jogamp.opencl.demos.radixsort.RadixSort.radixSortStepKeysOnly (RadixSort.java: 103) 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: 80) at com.jogamp.opencl.demos.radixsort.RadixSortDemo.main (RadixSortDemo.java: 131) What am I doing wrong? I think that has to do with the size of localWorkSize and Size of the globalWorkSize but i do not understand how these values fit the new size of my array. Thanks and regards Rui Silva |
the global work size (specified by the NDRange) must be evenly divisible by the local work size. Thats the reason why you can't use arbitrary input buffer lenghts without additional work. The HelloJOCL sample does this right and allows to use arbitrary buffer lengths. Take a look at the bounds check in the opencl kernel and the first three lines of the java code: kernel void VectorAdd(global const float* a, global const float* b, global float* c, int numElements) { java: int elementCount = 11444777; // Length of arrays to process the Nvidia sorting examples don't do this, thats why you get the exception. hope that helps a bit, best regards, michael On 12/17/2010 10:19 PM, Rui Silva [via jogamp] wrote: Hello, -- - - - - http://michael-bien.com |
Free forum by Nabble | Edit this page |