Program#

APIs to create and manage CmdPrograms required for scheduling work on PVA engine.

Functions#

cupvaError_t CupvaCmdMemcpyCreate(cupvaCmd_t *const cmdMemcpy, cupvaCmdMemcpyBufferParams_t *const cmdMemcpyBufferParams, size_t const count)

Create a CmdMemcpy command to copy 1D data from source memory area to destination memory area.

cupvaError_t CupvaCmdMemcpyCreate2D(cupvaCmd_t *const cmdMemcpy, cupvaCmdMemcpyBufferParams_t *const cmdMemcpyBufferParams, size_t const dstLinePitch, size_t const srcLinePitch, size_t const width, size_t const height)

Create a CmdMemcpy command to copy 2D data from source memory area to destination memory area.

cupvaError_t CupvaCmdProgramAddDataFlow(cupvaCmd_t *const prog, cupvaDataFlow_t *const df, cupvaDataFlowType_t const dfType)

Add a dataflow to the given program.

cupvaError_t CupvaCmdProgramAddDataFlowHead(cupvaCmd_t *const prog, cupvaDataFlow_t *const df, cupvaDataFlowType_t const dfType, int32_t const phase, float32_t const weight)

Add a dataflow head to the given program.

cupvaError_t CupvaCmdProgramAddDataFlowHeadShared(cupvaCmd_t *const prog, cupvaDataFlow_t *const df, cupvaDataFlowType_t const dfType, cupvaDataFlow_t const sharedDf)

Add a dataflow head to the given program with resource sharing.

cupvaError_t CupvaCmdProgramCompileDataFlows(cupvaCmd_t *const cmdProg)

Compile dataflows within the given program.

cupvaError_t CupvaCmdProgramCreate(cupvaCmd_t *const cmdProg, cupvaExecutable_t const exec)

Create a Program command from the given executable.

cupvaError_t CupvaCmdProgramGetParameter(cupvaCmd_t *const cmdProg, cupvaParameter_t *const param, char const *const name)

Get parameter info for "name" entry in the given program.

cupvaError_t CupvaCmdProgramSetL2Size(cupvaCmd_t *const cmdProg, int32_t const size)

Set CmdProgram instance L2SRAM utilization.

cupvaError_t CupvaCmdProgramUpdateDataFlows(cupvaCmd_t *const cmdProg)

Update dataflows within the given program.

cupvaError_t CupvaOffsetPointerApplyOffset(cupvaOffsetPointer_t *const offsetPtr, ptrdiff_t const offset)

Update the offset stored in an OffsetPointer object.

cupvaError_t CupvaOffsetPointerCreate(cupvaOffsetPointer_t *const offsetPtr, cupvaMemType_t const type, void *const basePtr)

Construct a new OffsetPointer object.

cupvaError_t CupvaOffsetPointerCreateFrom(cupvaOffsetPointer_t *const dstOffsetPtr, cupvaOffsetPointer_t const *const srcOffsetPtr, ptrdiff_t const offset)

Create OffsetPointer object which shares the base of another OffsetPointer object.

cupvaError_t CupvaOffsetPointerDestroy(cupvaOffsetPointer_t *const offsetPtr)

Release an offsetpointer.

cupvaError_t CupvaOffsetPointerSetBase(cupvaOffsetPointer_t *const offsetPtr, void *const basePtr)

Set the base pointer value and reset offset to zero.

cupvaError_t CupvaParameterGetDevicePointer(cupvaParameter_t *const param, void const **const ptr)

Get the device pointer of a parameter.

cupvaError_t CupvaParameterSetValueArray(cupvaParameter_t *const param, const void *const dataPtr, int64_t const dataSizeInBytes)

Set values for given array.

cupvaError_t CupvaParameterSetValuePointer(cupvaParameter_t *const param, void *const dataPtr)

Set value of given pointer.

cupvaError_t CupvaParameterSetValueScalar(cupvaParameter_t *const param, const void *const dataPtr, int64_t const dataSizeInBytes)

Set values for given scalar.

Data Structures#

cupvaCmdMemcpyBufferParams_t

Parameters structure for setting source and destination pointers for CmdMemcpy.

cupvaOffsetPointer_t

A handle to a device pointer which can be modified without recompiling DMA descriptors.

cupvaParameter_t

A handle to a symbol in the VPU executable.

Typedefs#

float32_t

Explicit alias for 32bit floating point.

Functions#

cupvaError_t CupvaCmdMemcpyCreate(
cupvaCmd_t *const cmdMemcpy,
cupvaCmdMemcpyBufferParams_t *const cmdMemcpyBufferParams,
size_t const count,
)#

Create a CmdMemcpy command to copy 1D data from source memory area to destination memory area.

CmdMemcpy command copies source memory area to the destination memory area using the PVA DMA engines. CmdMemcpy can be submitted to a CUPVA Stream similar to the CmdProgram. Memory areas in DRAM and L2SRAM are supported by CmdMemcpy. CmdMemcpy cannot be used to copy data from VMEM or to VMEM.

For the purposes of L2 persistence, if CmdMemcpy targets L2SRAM as a source or destination, it will behave the same as a CmdProgram with a non-zero L2 allocation. Otherwise, it will not be considered to have an L2 allocation. Refer cupva::CmdProgram::setL2Size for more details on L2 persistence.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • cmdMemcpy[in] The pointer to CUPVA command object.

  • cmdMemcpyBufferParams[in] The pointer to cupvaCmdMemcpyBufferParams_t struct.

  • count[in] The number of bytes to be copied.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT indicates one of the following:

  • a NULL cmdMemcpy or cmdMemcpyBufferParams was provided.

  • both of cmdMemcpyBufferParams->ptrSrc and cmdMemcpyBufferParams->opSrc parameters are NULL or non-NULL.

  • both of cmdMemcpyBufferParams->ptrDst and cmdMemcpyBufferParams->opDst parameters are NULL or non-NULL.

  • destination or source is not registered as a device pointer in DRAM, L2SRAM (Orin only)

  • destination or source is a L2SRAM pointer and memory access outside the L2SRAM boundaries is requested.

  • destination or source is a VMEM pointer.

  • count exceeds maximum allowable limit.

  • CUPVA_NOT_ALLOWED_IN_OPERATIONAL_STATE if called when NVIDIA DRIVE OS VM state is “Operational”

cupvaError_t CupvaCmdMemcpyCreate2D(
cupvaCmd_t *const cmdMemcpy,
cupvaCmdMemcpyBufferParams_t *const cmdMemcpyBufferParams,
size_t const dstLinePitch,
size_t const srcLinePitch,
size_t const width,
size_t const height,
)#

Create a CmdMemcpy command to copy 2D data from source memory area to destination memory area.

CmdMemcpy command copies source memory area to the destination memory area using the PVA DMA engines. CmdMemcpy can be submitted to a CUPVA Stream similar to the CmdProgram. Memory areas in DRAM and L2SRAM are supported by CmdMemcpy. CmdMemcpy cannot be used to copy data from VMEM or to VMEM.

For the purposes of L2 persistence, if CmdMemcpy targets L2SRAM as a source or destination, it will behave the same as a CmdProgram with a non-zero L2 allocation. Otherwise, it will not be considered to have an L2 allocation. Refer cupva::CmdProgram::setL2Size for more details on L2 persistence.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • cmdMemcpy[in] The pointer to CUPVA command object.

  • cmdMemcpyBufferParams[in] The pointer to cupvaCmdMemcpyBufferParams_t struct.

  • dstLinePitch[in] Line pitch of the destination memory in bytes.

  • srcLinePitch[in] Line pitch of the source memory in bytes.

  • width[in] The width of the 2D transfer in bytes.

  • height[in] The height of the 2D transfer.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT indicates one of the following:

  • a NULL cmdMemcpy or cmdMemcpyBufferParams was provided.

  • both of cmdMemcpyBufferParams->ptrSrc and cmdMemcpyBufferParams->opSrc parameters are NULL or non-NULL.

  • both of cmdMemcpyBufferParams->ptrDst and cmdMemcpyBufferParams->opDst parameters are NULL or non-NULL.

  • destination or source is not registered as a device pointer in DRAM, L2SRAM (Orin only)

  • destination or source is a L2SRAM pointer and memory access outside the L2SRAM boundaries is requested.

  • destination or source is a VMEM pointer.

  • dstLinePitch, srcLinePitch, width or height exceeds maximum allowable limit.

  • width is greater than the dstLinePitch or srcLinePitch.

  • CUPVA_NOT_ALLOWED_IN_OPERATIONAL_STATE if called when NVIDIA DRIVE OS VM state is “Operational”

cupvaError_t CupvaCmdProgramAddDataFlow(
cupvaCmd_t *const prog,
cupvaDataFlow_t *const df,
cupvaDataFlowType_t const dfType,
)#

Add a dataflow to the given program.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • prog[in] The pointer to CUPVA command object.

  • df[out] The pointer to return the DataFlow object.

  • dfType[in] CUPVA DataFlow type

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT indicates one of the followings:

    • a NULL prog or df was provided.

    • an invalid dfType was provided.

  • CUPVA_INTERNAL_ERROR if memory allocation failed.

  • CUPVA_NOT_ALLOWED_IN_OPERATIONAL_STATE if called when NVIDIA DRIVE OS VM state is “Operational”

cupvaError_t CupvaCmdProgramAddDataFlowHead(
cupvaCmd_t *const prog,
cupvaDataFlow_t *const df,
cupvaDataFlowType_t const dfType,
int32_t const phase,
float32_t const weight,
)#

Add a dataflow head to the given program.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • prog[in] The pointer to CUPVA command object.

  • df[out] The pointer to return the DataFlow object.

  • dfType[in] CUPVA DataFlow type

  • phase[in] Index identifying the Phase the dataflow-list belongs to. Should not be negative.

  • weight[in] Floating point number which will be multiplied with the maximum transfer size linked to this DataFlowHead when determining transfer buffer allocation. Must be larger than zero.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT indicates one of the followings:

    • a NULL prog or df was provided.

    • Invalid dfType, phase or weight was provided

  • CUPVA_INTERNAL_ERROR if memory allocation failed.

  • CUPVA_NOT_ALLOWED_IN_OPERATIONAL_STATE if called when NVIDIA DRIVE OS VM state is “Operational”

cupvaError_t CupvaCmdProgramAddDataFlowHeadShared(
cupvaCmd_t *const prog,
cupvaDataFlow_t *const df,
cupvaDataFlowType_t const dfType,
cupvaDataFlow_t const sharedDf,
)#

Add a dataflow head to the given program with resource sharing.

The transfer buffers used by df and its linked DataFlows will be shared with the sharedDf. These DataFlows must therefore not be active simultaneously. Additionally, any DataFlows created with this API (or linked to such a DataFlow) must not be active concurrently with any DataFlows which have phases different to the specified BaseDataFlow. These conditions should be achieved via careful use of trigger/sync APIs in device code. Failure to ensure this can lead to data corruption or instability.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • prog[in] The pointer to CUPVA command object.

  • df[out] The pointer to return the DataFlow object.

  • dfType[in] CUPVA DataFlow type

  • sharedDf[in] A CUPVA DataFlow object created with CupvaCmdProgramAddDataFlowHead, with which the created DataFlowHead should share transfer resources.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT indicates one of the followings:

    • a NULL prog, df or sharedDf was provided.

    • Invalid dfType was provided

  • CUPVA_INTERNAL_ERROR if memory allocation failed.

  • CUPVA_NOT_ALLOWED_IN_OPERATIONAL_STATE if called when NVIDIA DRIVE OS VM state is “Operational”

cupvaError_t CupvaCmdProgramCompileDataFlows(
cupvaCmd_t *const cmdProg,
)#

Compile dataflows within the given program.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:

cmdProg[in] The pointer to CUPVA command object.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT indicates one of the followings:

    • the RasterDataFlow’s handler is not set.

    • both RasterDataFlow’s src and dst buffers are in VMEM or neither of them are in VMEM.

    • the RasterDataFlow’s tile size is not set.

    • the RasterDataFlow’s roi size is smaller than the tile size.

    • the RasterDataFlow’s roi size exceeds the boundary.

    • the RasterDataFlow is configured to write out data from VMEM but padDim is non-zero.

    • the RasterDataFlow objects are linked circularly.

    • the StaticDataFlow’s src is not set.

    • the StaticDataFlow’s dst is not set.

    • the StaticDataFlow’s src line-pitch is not set but the tile height is greater than 1.

    • the StaticDataFlow’s src line-pitch is not smaller than tile width - horizontal padDim.

    • the StaticDataFlow’s dst line-pitch is not set but the tile height is greater than 1.

    • the StaticDataFlow’s dst line-pitch is not smaller than tile width - horizontal padDim.

    • the StaticDataFlow’s src iteration number doesn’t equal to dst.

    • the StaticDataFlow’s horizontal padDim is greater than tile width when tile width is non-zero.

    • the StaticDataFlow’s vertical padDim is greater than tile height when tile height is non-zero.

    • the StaticDataFlow uses DMA padding but dst is not in VMEM.

    • the StaticDataFlow’s byte-per-pixel is not in [1, 2, 4].

    • the StaticDataFlow’s src circular buffer is enabled but its length is not 64-byte-aligned.

    • the StaticDataFlow’s dst circular buffer is enabled but its length is not 64-byte-aligned.

    • the ConfigDataFlow’s src is not set.

  • CUPVA_INVALID_STATE indicates possible following errors:

    • a StaticDataFlow is appended in a list and its granularity is ALL but assigned a trigger.

    • a StaticDataFlow is configured as no-trigger but its granularity is not ALL.

    • a ConfigDataFlow is appended in a list but assigned a trigger.

    • the number of descriptors exceeds the limitation(64).

    • a DataFlow object is allocated as head but linked or appended.

    • the DataFlow objects in a list have different padding values when using constant-padding.

    • a parameter is assigned to 2 DataFlows but their trigger types conflict.

    • the number of allocating triggers exceeds the hardware limitation.

    • there are no available reading/writing DataFlowBuffer slots.

    • the object is not instantiated correctly.

  • CUPVA_DRIVER_API_ERROR driver API layer returned error during allocation of resources for compiled DMA configuration.

  • CUPVA_NOT_ALLOWED_IN_OPERATIONAL_STATE if called when NVIDIA DRIVE OS VM state is “Operational”

cupvaError_t CupvaCmdProgramCreate(
cupvaCmd_t *const cmdProg,
cupvaExecutable_t const exec,
)#

Create a Program command from the given executable.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: Yes

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • cmdProg[in] The pointer to CUPVA command object.

  • exec[in] The pointer to cupvaExecutableRec struct.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if the executable size <= 0.

  • CUPVA_DRIVER_API_ERROR if driver returned error due to one of the following:

    • executable data was nullptr.

    • executable size was zero.

    • Internal driver memory allocation failed.

    • Parsing executable object failed.

    • PVA engine is in a bad state.

  • CUPVA_NOT_ALLOWED_IN_OPERATIONAL_STATE if called when NVIDIA DRIVE OS VM state is “Operational”

cupvaError_t CupvaCmdProgramGetParameter(
cupvaCmd_t *const cmdProg,
cupvaParameter_t *const param,
char const *const name,
)#

Get parameter info for “name” entry in the given program.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: Yes

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • cmdProg[in] The pointer to CUPVA command object.

  • param[out] The pointer to return a cupvaParameter_t object.

  • name[in] The parameter name.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if one of the following errors occurred:

    • name is not NULL terminated or too long.

    • name could not be looked up from symbols known to the driver API layer for the underlying Executable.

cupvaError_t CupvaCmdProgramSetL2Size(
cupvaCmd_t *const cmdProg,
int32_t const size,
)#

Set CmdProgram instance L2SRAM utilization.

L2SRAM is a fast on-chip memory exposed in CUPVA as a temporary scratchpad type memory.

L2SRAM memory is typically scoped to the CmdProgram. It is allocated on-demand while processing CmdProgram instances from a particular submission. If the allocation request cannot be fulfilled before CmdProgram begins execution, the submission will stall until allocation can succeed.

An L2SRAM allocation is shared between subsequent (in the submission order) CmdProgram instances that have declared a non-zero L2SRAM use and belong to the same submission. The allocation size in this case is defined as the largest allocation among subsequent CmdProgram instances that use L2SRAM.

An application programmer can use CupvaMemGetL2BaseAddress() API to query a symbolic device pointer to the allocated L2SRAM and use it in data flow APIs.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:
  • cmdProg[in] The pointer to CUPVA command object.

  • size[in] The required L2SRAM size in bytes.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if size < 0 or size > cupva::config::MAX_L2SRAM_SIZE.

cupvaError_t CupvaCmdProgramUpdateDataFlows(
cupvaCmd_t *const cmdProg,
)#

Update dataflows within the given program.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:

cmdProg[in] The pointer to CUPVA command object.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if an invalid src or dst pointer was provided

  • CUPVA_DRIVER_API_ERROR if driver API layer returned error when programming PVA DMA descriptor.

cupvaError_t CupvaOffsetPointerApplyOffset(
cupvaOffsetPointer_t *const offsetPtr,
ptrdiff_t const offset,
)#

Update the offset stored in an OffsetPointer object.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • offsetPtr[in] The pointer to the OffsetPointer instance to be updated.

  • offset[in] The increment in bytes if offset is a positive value or the decrement in bytes.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

cupvaError_t CupvaOffsetPointerCreate(
cupvaOffsetPointer_t *const offsetPtr,
cupvaMemType_t const type,
void *const basePtr,
)#

Construct a new OffsetPointer object.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: Yes

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • offsetPtr[out] The pointer to return the newly constructed OffsetPointer object.

  • type[in] The cupvaMemType_t of this OffsetPointer.

  • basePtr[in] initial base pointer value.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if object not properly initialized from CupvaCmdProgramGetParameter API.

  • CUPVA_INTERNAL_ERROR if memory allocation failed.

cupvaError_t CupvaOffsetPointerCreateFrom(
cupvaOffsetPointer_t *const dstOffsetPtr,
cupvaOffsetPointer_t const *const srcOffsetPtr,
ptrdiff_t const offset,
)#

Create OffsetPointer object which shares the base of another OffsetPointer object.

This function will add srcOffsetPtr by offset in bytes if offset is a positive value or subtract srcOffsetPtr from offset in bytes if offset is a negative value, and then return the result in dstOffsetPtr.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • dstOffsetPtr[out] The pointer to the OffsetPointer object containing the result. The dest OffsetPointer object will be initialized by this function, so user doesn’t need to call CupvaOffsetPointerCreate() to create an OffsetPointer object first.

  • srcOffsetPtr[in] The pointer to the source OffsetPointer instance.

  • offset[in] The increment in bytes if offset is a positive value or the decrement in bytes.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

cupvaError_t CupvaOffsetPointerDestroy(
cupvaOffsetPointer_t *const offsetPtr,
)#

Release an offsetpointer.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: No

    • De-Init: Yes

Parameters:

offsetPtr[out] The pointer to an OffsetPointer instance.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

cupvaError_t CupvaOffsetPointerSetBase(
cupvaOffsetPointer_t *const offsetPtr,
void *const basePtr,
)#

Set the base pointer value and reset offset to zero.

Set the base pointer value which is shared between the group of all OffsetPointers created via CupvaOffsetPointerCreateFrom. The offset for this instance is reset to zero. The offsets for other OffsetPointers which share the base pointer will remain unchanged.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:
  • offsetPtr[in] The cupvaOffsetPointer_t to update.

  • basePtr[in] the new device pointer to be set as a base address. The offset is reset to zero. All copies of this object will have their base pointers updated as well, but their offsets will remain unchanged.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_UNINITIALIZED_OBJECT if object was not constructed via CupvaOffsetPointerInit().

  • CUPVA_INVALID_ARGUMENT if basePtr is not a valid device pointer in the Context current to the calling thread

cupvaError_t CupvaParameterGetDevicePointer(
cupvaParameter_t *const param,
void const **const ptr,
)#

Get the device pointer of a parameter.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: Yes

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:
  • param[in] The pointer to CUPVA parameter object.

  • ptr[out] The double pointer to return the device pointer of param.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if object not properly initialized from CupvaCmdProgramGetParameter API.

cupvaError_t CupvaParameterSetValueArray(
cupvaParameter_t *const param,
const void *const dataPtr,
int64_t const dataSizeInBytes,
)#

Set values for given array.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:
  • param[in] The pointer to CUPVA parameter object.

  • dataPtr[in] The pointer to the host array.

  • dataSizeInBytes[in] The size of the host array in bytes.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if one of the following errors occurred:

    • object not properly initialized from CupvaCmdProgramGetParameter API.

    • dataSizeInBytes <= 0.

  • CUPVA_DRIVER_API_ERROR if driver API layer returned error while setting the parameter.

cupvaError_t CupvaParameterSetValuePointer(
cupvaParameter_t *const param,
void *const dataPtr,
)#

Set value of given pointer.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:
  • param[in] The pointer to CUPVA parameter object.

  • dataPtr[in] The DRAM device pointer.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if one of the following errors occurred:

    • object not properly initialized from CupvaCmdProgramGetParameter API.

    • dataPtr was not registered as a device pointer.

  • CUPVA_DRIVER_API_ERROR if driver API layer returned error while setting the parameter.

cupvaError_t CupvaParameterSetValueScalar(
cupvaParameter_t *const param,
const void *const dataPtr,
int64_t const dataSizeInBytes,
)#

Set values for given scalar.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:
  • param[in] The pointer to CUPVA parameter object.

  • dataPtr[in] The pointer to a scalar value to be copied to VMEM.

  • dataSizeInBytes[in] The size of the host array in bytes.

Returns:

cupvaError_t The completion status of the operation. Possible values are:

  • CUPVA_ERROR_NONE if the operation was successful.

  • CUPVA_INVALID_ARGUMENT if one of the following errors occurred:

    • object not properly initialized from CupvaCmdProgramGetParameter API.

    • dataSizeInBytes <= 0, dataSizeInBytes > 8, or dataSizeInBytes is not a power of 2.

  • CUPVA_DRIVER_API_ERROR if driver API layer returned error while setting the parameter.

Typedefs#

typedef float float32_t#

Explicit alias for 32bit floating point.