Dense Vector APIs
The cuSPARSE helper functions for dense vector descriptor are described in this section.
See the Dense Vector Format section for the detailed description of the storage format.
cusparseCreateDnVec()
cusparseStatus_t
cusparseCreateDnVec(cusparseDnVecDescr_t* dnVecDescr,
int64_t size,
void* values,
cudaDataType valueType)
cusparseStatus_t
cusparseCreateConstDnVec(cusparseConstDnVecDescr_t* dnVecDescr,
int64_t size,
const void* values,
cudaDataType valueType)
This function initializes the dense vector descriptor dnVecDescr
.
Param. |
Memory |
In/out |
Meaning |
---|---|---|---|
|
HOST |
OUT |
Dense vector descriptor |
|
HOST |
IN |
Size of the dense vector |
|
DEVICE |
IN |
Values of the dense vector. Array with |
|
HOST |
IN |
Enumerator specifying the datatype of |
See cusparseStatus_t for the description of the return status.
cusparseDestroyDnVec()
cusparseStatus_t
cusparseDestroyDnVec(cusparseConstDnVecDescr_t dnVecDescr) // non-const descriptor supported
This function releases the host memory allocated for the dense vector descriptor dnVecDescr
.
Param. |
Memory |
In/out |
Meaning |
---|---|---|---|
|
HOST |
IN |
Dense vector descriptor |
See cusparseStatus_t for the description of the return status.
cusparseDnVecGet()
cusparseStatus_t
cusparseDnVecGet(cusparseDnVecDescr_t dnVecDescr,
int64_t* size,
void** values,
cudaDataType* valueType)
cusparseStatus_t
cusparseConstDnVecGet(cusparseConstDnVecDescr_t dnVecDescr,
int64_t* size,
const void** values,
cudaDataType* valueType)
This function returns the fields of the dense vector descriptor dnVecDescr
.
Param. |
Memory |
In/out |
Meaning |
---|---|---|---|
|
HOST |
IN |
Dense vector descriptor |
|
HOST |
OUT |
Size of the dense vector |
|
DEVICE |
OUT |
Values of the dense vector. Array with |
|
HOST |
OUT |
Enumerator specifying the datatype of |
See cusparseStatus_t for the description of the return status.
cusparseDnVecGetValues()
cusparseStatus_t
cusparseDnVecGetValues(cusparseDnVecDescr_t dnVecDescr,
void** values)
cusparseStatus_t
cusparseConstDnVecGetValues(cusparseConstDnVecDescr_t dnVecDescr,
const void** values)
This function returns the values
field of the dense vector descriptor dnVecDescr
.
Param. |
Memory |
In/out |
Meaning |
---|---|---|---|
|
HOST |
IN |
Dense vector descriptor |
|
DEVICE |
OUT |
Values of the dense vector |
See cusparseStatus_t for the description of the return status.
cusparseDnVecSetValues()
cusparseStatus_t
cusparseDnVecSetValues(cusparseDnVecDescr_t dnVecDescr,
void* values)
This function set the values
field of the dense vector descriptor dnVecDescr
.
Param. |
Memory |
In/out |
Meaning |
---|---|---|---|
|
HOST |
IN |
Dense vector descriptor |
|
DEVICE |
IN |
Values of the dense vector. Array with |
See cusparseStatus_t for the description of the return status.