code: public static Range create(Device _device, int _globalWidth) {
        final Range withoutLocal = create(_device, _globalWidth, 1);
  
        if (_device == JavaDevice.THREAD_POOL) {
           withoutLocal.setLocalSize_0(Runtime.getRuntime().availableProcessors());
           withoutLocal.setLocalIsDerived(true);
           return withoutLocal;
        } else if (_device instanceof JavaDevice) {
           withoutLocal.setLocalIsDerived(true);
           return withoutLocal;
        }
  
        if (_globalWidth == 0) {
           withoutLocal.setLocalIsDerived(true);
           return withoutLocal;
        }
  
        if (withoutLocal.isValid()) {
           withoutLocal.setLocalIsDerived(true);
           final int[] factors = getFactors(withoutLocal.getGlobalSize_0(), withoutLocal.getMaxWorkItemSize()[0]);
  
           withoutLocal.setLocalSize_0(factors[factors.length - 1]);
  
           withoutLocal.setValid((withoutLocal.getLocalSize_0() > 0)
                 && (withoutLocal.getLocalSize_0() <= withoutLocal.getMaxWorkItemSize()[0])
                 && (withoutLocal.getLocalSize_0() <= withoutLocal.getMaxWorkGroupSize())
                 && ((withoutLocal.getGlobalSize_0() % withoutLocal.getLocalSize_0()) == 0));
        }
  
        return (withoutLocal);
     }
docs: Create a one dimensional range <code>0.._globalWidth</code> with an undefined group size.
  <br/>
  Note that for this range to be valid :- </br> <strong><code>_globalWidth > 0 </code></strong>
  <br/>
  The groupsize will be chosen such that _localWidth > 0 && _localWidth < MAX_GROUP_SIZE && _globalWidth % _localWidth==0 is true
  
  We extract the factors of _globalWidth and choose the highest value.
  
  @param _globalWidth the overall range we wish to process
  @return A new Range with the requested dimensions