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

Method create3D

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

Create a two dimensional range 0.._globalWidth 0.._globalHeight 0../_globalDepth in groups defined by localWidth localHeight localDepth . Note that for this range to be valid _globalWidth > 0 && _globalHeight >0 _globalDepth >0 && _loca

(Device _device, int _globalWidth, int _globalHeight, int _globalDepth, int _localWidth,
         int _localHeight, int _localDepth)

Source from the content-addressed store, hash-verified

311 * @return
312 */
313 public static Range create3D(Device _device, int _globalWidth, int _globalHeight, int _globalDepth, int _localWidth,
314 int _localHeight, int _localDepth) {
315 final Range range = new Range(_device, 3);
316
317 range.setGlobalSize_0(_globalWidth);
318 range.setLocalSize_0(_localWidth);
319 range.setGlobalSize_1(_globalHeight);
320 range.setLocalSize_1(_localHeight);
321 range.setGlobalSize_2(_globalDepth);
322 range.setLocalSize_2(_localDepth);
323 range.setValid((range.getLocalSize_0() > 0) && (range.getLocalSize_1() > 0) && (range.getLocalSize_2() > 0)
324 && ((range.getLocalSize_0() * range.getLocalSize_1() * range.getLocalSize_2()) <= range.getMaxWorkGroupSize())
325 && (range.getLocalSize_0() <= range.getMaxWorkItemSize()[0])
326 && (range.getLocalSize_1() <= range.getMaxWorkItemSize()[1])
327 && (range.getLocalSize_2() <= range.getMaxWorkItemSize()[2])
328 && ((range.getGlobalSize_0() % range.getLocalSize_0()) == 0)
329 && ((range.getGlobalSize_1() % range.getLocalSize_1()) == 0)
330 && ((range.getGlobalSize_2() % range.getLocalSize_2()) == 0));
331
332 return (range);
333 }
334
335 /**
336 * Create a three dimensional range <code>0.._globalWidth * 0.._globalHeight *0../_globalDepth</code>

Callers 2

recreateRangeMethod · 0.95
createRange3DMethod · 0.95

Calls 15

setGlobalSize_0Method · 0.95
setLocalSize_0Method · 0.95
setGlobalSize_1Method · 0.95
setLocalSize_1Method · 0.95
setGlobalSize_2Method · 0.95
setLocalSize_2Method · 0.95
setValidMethod · 0.95
getLocalSize_0Method · 0.95
getLocalSize_1Method · 0.95
getLocalSize_2Method · 0.95
getMaxWorkGroupSizeMethod · 0.95
getMaxWorkItemSizeMethod · 0.95

Tested by

no test coverage detected