CuVSMatrix
Java package: com.nvidia.cuvs
This represents a wrapper for a dataset to be used for index construction. The purpose is to allow a caller to place the vectors into native memory directly, instead of requiring the caller to load all the vectors into the heap (e.g. with a float[][]).
Public Members
ofArray
Creates a dataset from an on-heap array of vectors. This method will allocate an additional MemorySegment to hold the graph data.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:47
ofArray
Creates a dataset from an on-heap array of vectors. This method will allocate an additional MemorySegment to hold the graph data.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:57
ofArray
Creates a dataset from an on-heap array of vectors. This method will allocate an additional MemorySegment to hold the graph data.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:67
addVector
Adds a single vector to the matrix.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:81
addVector
Adds a single vector to the matrix.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:88
addVector
Adds a single vector to the matrix.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:95
addVector
Adds a single vector to the matrix. Each element is a raw float16 bit pattern stored in a short.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:102
build
Completes the matrix and transfers ownership to the caller.
If this method fails, callers should close the builder. Built-in builders then release
matrix storage allocated during builder construction; providers that inherit the default
no-op #close() implementation do not.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:111
close
Closes this builder. Built-in builders release matrix storage unless ownership was
transferred by a successful #build().
The default implementation preserves compatibility with providers compiled before
builders became closeable. Builders that allocate storage before #build() should
override this method.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:121
hostBuilder
Returns a builder to create a new instance of a host-memory matrix
Parameters
Returns
a builder for creating a CuVSHostMatrix
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:133
hostBuilder
Returns a builder to create a new instance of a host-memory matrix
Parameters
Returns
a builder for creating a CuVSDeviceMatrix
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:147
deviceBuilder
Returns a builder to create a new instance of a dataset
Parameters
Returns
a builder for creating a CuVSDeviceMatrix
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:162
deviceBuilder
Returns a builder to create a new instance of a dataset
Parameters
Returns
a builder for creating a CuVSDeviceMatrix
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:178
size
Gets the size of the dataset
Returns
Size of the dataset
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:194
columns
Gets the number of columns in the Dataset (e.g. the dimensions of the vectors in this dataset, or the graph degree for the graph represented as a list of neighbours
Returns
Dimensions of the vectors in the dataset
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:202
dataType
Gets the element type
Returns
a DataType describing the matrix element type
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:209
getRow
Get a view (0-copy) of the row data, as a list of integers (32 bit)
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:216
toArray
Copies the content of this dataset to an on-heap Java matrix (array of arrays).
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:224
toArray
Copies the content of this dataset to an on-heap Java matrix (array of arrays).
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:232
toArray
Copies the content of this dataset to an on-heap Java matrix (array of arrays).
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:240
toHost
Fills the provided, pre-allocated host matrix with data from this matrix. The content of the provided host matrix will be overwritten; the 2 matrices must have the same element type and dimension.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:249
toHost
Returns a host matrix; if the matrix is already a host matrix, a “weak” reference to the same host memory
is returned. If the matrix is a device matrix, a newly allocated matrix will be populated with data from
the device matrix.
The returned host matrix will need to be managed by the caller, which will be
responsible to call CuVSMatrix#close() to free its resources when done.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:258
toDevice
Fills the provided, pre-allocated device matrix with data from this matrix. The content of the provided device matrix will be overwritten; the 2 matrices must have the same element type and dimension.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:267
toDevice
Returns a device matrix; if this matrix is already a device matrix, a “weak” reference to the same host memory
is returned. If the matrix is a host matrix, a newly allocated matrix will be populated with data from
the host matrix.
The returned device matrix will need to be managed by the caller, which will be
responsible to call CuVSMatrix#close() to free its resources when done.
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:276
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:17