docs: protected Integer getNextDevice(long threadId) {
          Integer device = null;
          if (!CudaEnvironment.getInstance().getConfiguration().isForcedSingleGPU() && getNumberOfDevices() > 0) {
              // simple round-robin here
              synchronized (this) {
                  device = CudaEnvironment.getInstance().getConfiguration().getAvailableDevices().get(devPtr.getAndIncrement());
  
                  // We check only for number of entries here, not their actual values
                  if (devPtr.get() >= CudaEnvironment.getInstance().getConfiguration().getAvailableDevices().size())
                      devPtr.set(0);
  
                  val t = Thread.currentThread();
                  val n = t.getId() == threadId ? t.getName() : "N/A";
  
                  logger.debug("Mapping thread [{} - {}] to device [{}], out of [{}] devices...", threadId, n, device, CudaEnvironment.getInstance().getConfiguration().getAvailableDevices().size());
              }
          } else {
              device = CudaEnvironment.getInstance().getConfiguration().getAvailableDevices().get(0);
              logger.debug("Single device is forced, mapping to device [{}]", device);
          }
  
          return device;
      }