MCPcopy Create free account
hub / github.com/Syncleus/aparapi / create

Method create

src/main/java/com/aparapi/Range.java:111–121  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Calls 10

setGlobalSize_0Method · 0.95
setLocalSize_0Method · 0.95
setValidMethod · 0.95
getLocalSize_0Method · 0.95
getMaxWorkItemSizeMethod · 0.95
getMaxWorkGroupSizeMethod · 0.95
getGlobalSize_0Method · 0.95
setLocalIsDerivedMethod · 0.95
isValidMethod · 0.95
getFactorsMethod · 0.95