Create a one dimensional range 0.._globalWidth which is processed in groups of size _localWidth. Note that for this range to be valid : _globalWidth > 0 && _localWidth > 0 && _localWidth < MAX_GROUP_SIZE && _globalWidth % _localWidth==0 @param
(Device _device, int _globalWidth, int _localWidth)
| 109 | * @return A new Range with the requested dimensions |
| 110 | */ |
| 111 | public static Range create(Device _device, int _globalWidth, int _localWidth) { |
| 112 | final Range range = new Range(_device, 1); |
| 113 | |
| 114 | range.setGlobalSize_0(_globalWidth); |
| 115 | range.setLocalSize_0(_localWidth); |
| 116 | |
| 117 | range.setValid((range.getLocalSize_0() > 0) && (range.getLocalSize_0() <= range.getMaxWorkItemSize()[0]) |
| 118 | && (range.getLocalSize_0() <= range.getMaxWorkGroupSize()) && ((range.getGlobalSize_0() % range.getLocalSize_0()) == 0)); |
| 119 | |
| 120 | return (range); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Determine the set of factors for a given value. |