code: protected void getDeviceBuffers(CudaContext context, int deviceId) {
          NativeOps nativeOps = NativeOpsHolder.getInstance().getDeviceNativeOps(); //((CudaExecutioner) Nd4j.getExecutioner()).getNativeOps();
  
          // we hardcode sizeOf to sizeOf(double)
          int sizeOf = 8;
  
          val reductionPointer = nativeOps.mallocDevice(16384 * sizeOf, deviceId, 0);
          if (reductionPointer == null)
              throw new IllegalStateException("Can't allocate [DEVICE] reduction buffer memory!");
  
          nativeOps.memsetAsync(reductionPointer, 0, 16384 * sizeOf, 0, context.getOldStream());
  
          context.syncOldStream();
  
          val allocationPointer = nativeOps.mallocDevice(16384 * sizeOf, deviceId, 0);
          if (allocationPointer == null)
              throw new IllegalStateException("Can't allocate [DEVICE] allocation buffer memory!");
  
          val scalarPointer = nativeOps.mallocHost(sizeOf, 0);
          if (scalarPointer == null)
              throw new IllegalStateException("Can't allocate [HOST] scalar buffer memory!");
  
          context.setBufferScalar(scalarPointer);
          context.setBufferAllocation(allocationPointer);
          context.setBufferReduction(reductionPointer);
  
          val specialPointer = nativeOps.mallocDevice(16384 * sizeOf, deviceId, 0);
          if (specialPointer == null)
              throw new IllegalStateException("Can't allocate [DEVICE] special buffer memory!");
  
          nativeOps.memsetAsync(specialPointer, 0, 16384 * sizeOf, 0, context.getOldStream());
  
          context.setBufferSpecial(specialPointer);
      }
docs: This method is used to allocate
  @param context
  @param deviceId