cuPHY
0.1
CUDA PHY Layer Acceration Library
|
This section describes the tensor operation functions of the cuPHY application programming interface. More...
Functions | |
cuphyStatus_t | cuphyConvertTensor (cuphyTensorDescriptor_t tensorDescDst, void *dstAddr, cuphyTensorDescriptor_t tensorDescSrc, const void *srcAddr, cudaStream_t strm) |
Converts a source tensor to a different type or layout. More... | |
cuphyStatus_t cuphyConvertTensor | ( | cuphyTensorDescriptor_t | tensorDescDst, |
void * | dstAddr, | ||
cuphyTensorDescriptor_t | tensorDescSrc, | ||
const void * | srcAddr, | ||
cudaStream_t | strm | ||
) |
Converts an input tensor (described by an address and a tensor descriptor) to an output tensor, possibly changing layout and/or data type in the process. The input and output tensors must have the same dimensions.
Tensors with identical data types, dimensions, and strides may be converted internally using a memory copy operation.
The following conversions are currently supported:
Other conversions are possible and may be added in the future.
tensorDescDst | - previously allocated cuphyTensorDescriptor_t for the destination (output) |
dstAddr | - tensor address for output data |
tensorDescSrc | - previously allocated cuphyTensorDescriptor_t for source data |
srcAddr | - tensor address for input data |
strm | - CUDA stream for memory copy |
Returns CUPHY_STATUS_INVALID_ARGUMENT if any of tensorDescDst
, dstAddr
, tensorDescSrc
, or srcAddr
is NULL, or if the data type of either tensorDescDst
or tensorDescSrc
is CUPHY_VOID.
Returns CUPHY_STATUS_SIZE_MISMATCH if all dimensions of tensor descriptors tensorDescDst
and tensorDescSrc
do not match.
Returns CUPHY_STATUS_MEMCPY_ERROR if an error occurred performing a memory copy from the source to the destination.
Returns CUPHY_STATUS_SUCCESS if the conversion operation was submitted to the given stream successfully.