CuVSResources
Java package: com.nvidia.cuvs
Used for allocating resources for cuVS
Public Members
handle
Gets the opaque CuVSResources handle, to be used whenever we need to pass a cuvsResources_t parameter
Returns
the CuVSResources handle
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:26
access
Gets scoped access to the native resources object.
The native resource object is not thread safe: only a single thread at every time should access
concurrently the same native resources. Calling this method from multiple thread is OK, but the
returned ScopedAccess object must be closed before calling access() again from a
different thread.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:39
deviceId
Get the logical id of the device associated with this resources object.
Information about the device id is immutable, so it is safe to expose it without getting ScopedAccess
to the enclosing resources.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:46
close
Closes this CuVSResources object and releases any resources associated with it.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:51
tempDirectory
The temporary directory to use for intermediate operations.
Defaults to java.io.tmpdir.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:58
setWorkspacePool
Configure the temporary workspace on this resources object as an uncapped pool backed by the
current device memory resource. After the initial reservation is allocated on first use,
subsequent calls to cuvsRMMAlloc / cuvsRMMFree on this handle hit the pool
cache rather than calling cudaMallocAsync / cudaFreeAsync, reducing CUDA
context lock contention under concurrent query threads. The pool grows without shrinking:
freed allocations are returned to the pool rather than to the device, so the pool’s
high-water mark only increases until the resources object is closed.
The pool is per-resources-handle (i.e. per query thread when resources are thread-local), so there is no cross-thread pool mutex contention. Call this once after creating the resources object; calling it again replaces the pool.
Parameters
Throws
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:78
create
Creates a new resources.
Equivalent to
create(CuVSProvider.tempDirectory())
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:87
create
Creates a new resources.
Parameters
Throws
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:98
create
Creates a new resources whose memory allocations are tracked and written as CSV samples from a background thread.
The returned handle wraps all reachable memory resources (host, pinned,
managed, device, workspace, large_workspace) with allocation-tracking
adaptors and replaces the global host and device memory resources for the
lifetime of the handle. It is otherwise indistinguishable from a handle
created by #create(Path) and can be used wherever a
CuVSResources is accepted. The CSV reporter is stopped and the
global memory resources are restored when the handle is closed.
Parameters
Throws
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:123
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSResources.java:16