88package org .elasticsearch .xpack .gpu .codec ;
99
1010import com .nvidia .cuvs .CuVSResources ;
11-
1211import com .nvidia .cuvs .GPUInfoProvider ;
13-
1412import com .nvidia .cuvs .spi .CuVSProvider ;
1513
1614import org .elasticsearch .core .Strings ;
@@ -83,8 +81,8 @@ class PoolingCuVSResourceManager implements CuVSResourceManager {
8381 static final GPUInfoProvider gpuInfoProvider = CuVSProvider .provider ().gpuInfoProvider ();
8482 static final PoolingCuVSResourceManager INSTANCE = new PoolingCuVSResourceManager (
8583 MAX_RESOURCES ,
86- res ->gpuInfoProvider .getCurrentInfo (res ).totalDeviceMemoryInBytes (),
87- res ->gpuInfoProvider .getCurrentInfo (res ).freeDeviceMemoryInBytes (),
84+ res -> gpuInfoProvider .getCurrentInfo (res ).totalDeviceMemoryInBytes (),
85+ res -> gpuInfoProvider .getCurrentInfo (res ).freeDeviceMemoryInBytes (),
8886 PoolingCuVSResourceManager ::getGpuUtilizationPercent
8987 );
9088
@@ -104,7 +102,7 @@ public PoolingCuVSResourceManager(
104102 GpuInfoFunction totalMemoryInBytesProvider ,
105103 GpuInfoFunction freeMemoryInBytesProvider ,
106104 GpuInfoFunction gpuUtilizationPercentProvider
107- ) {
105+ ) {
108106 this .totalMemoryInBytesProvider = totalMemoryInBytesProvider ;
109107 this .freeMemoryInBytesProvider = freeMemoryInBytesProvider ;
110108 this .gpuUtilizationPercentProvider = gpuUtilizationPercentProvider ;
@@ -193,7 +191,7 @@ public ManagedCuVSResources acquire(int numVectors, int dims) throws Interrupted
193191 }
194192
195193 private long estimateRequiredMemory (int numVectors , int dims ) {
196- return (long )(GPU_COMPUTATION_MEMORY_FACTOR * numVectors * dims * Float .BYTES );
194+ return (long ) (GPU_COMPUTATION_MEMORY_FACTOR * numVectors * dims * Float .BYTES );
197195 }
198196
199197 private static int getGpuUtilizationPercent (CuVSResources resources ) {
0 commit comments