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:46
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:56
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:66
addVector
Adds a single vector to the matrix.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:80
addVector
Adds a single vector to the matrix.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:87
addVector
Adds a single vector to the matrix.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:94
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:107
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:121
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:136
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:152
size
Gets the size of the dataset
Returns
Size of the dataset
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:168
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:176
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:183
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:190
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:198
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:206
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:214
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:223
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:232
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:241
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:250
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSMatrix.java:17