code: @Override
      public int getNumberOfDevices() {
          if (numberOfDevices.get() < 0) {
              synchronized (this) {
                  if (numberOfDevices.get() < 1) {
                      numberOfDevices.set(NativeOpsHolder.getInstance().getDeviceNativeOps().getAvailableDevices());
                  }
              }
          }
  
          return numberOfDevices.get();
      }
docs: This method returns number of available devices in system.
  
  Please note: returned value might be different from actual number of used devices.
  
  @return total number of devices