Conv2d#

Compatibility: Requires PVA SDK 2.6.0 and later.

Functions#

NVCVStatus pvaConv2dCreate(NVCVOperatorHandle *handle, NVCVTensorRequirements *tensorRequirements, const NVCVBorderType borderMode, int32_t borderValue, NVCVTensorHandle kernelCoefficients)

Constructs an instance of the Conv2d operator.

NVCVStatus pvaConv2dSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVTensorHandle in, NVCVTensorHandle out)

Submits the Conv2d operator to a cuPVA stream.

NVCVStatus pvaConv2dSubmit(NVCVOperatorHandle handle, cudaStream_t stream, NVCVTensorHandle in, NVCVTensorHandle out)

Submits the Conv2d operator to a CUDA stream.

Functions#

NVCVStatus pvaConv2dCreate(
NVCVOperatorHandle *handle,
NVCVTensorRequirements *tensorRequirements,
const NVCVBorderType borderMode,
int32_t borderValue,
NVCVTensorHandle kernelCoefficients,
)#

Constructs an instance of the Conv2d operator.

Limitations:

Input: Data Layout: [kHWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Output: Data Layout: [kHWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Input/Output Dependency:

Property

Input == Output

Data Layout

Yes

Data Type

Yes

Number

Yes

Channels

Yes

Width

Yes

Height

Yes

Kernel Coefficients:

Property

Requirement

Data Layout

[HWC] where C=1, H=W (square tensor)

Kernel Size

3x3, 5x5, or 7x7 only (Kernel size = H = W)

Data Type Width

Must match tensorRequirements data type width

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

Yes

16bit Unsigned

Yes

16bit Signed

Yes

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Parameters

 borderMode = NVCV_BORDER_CONSTANT or NVCV_BORDER_REPLICATE

Parameters:
  • handle[out] Where the operator instance handle will be written to.

    • Must not be NULL.

  • tensorRequirements[in] Pointer to the NVCVTensorRequirements structure which contains Tensor rank, shape, layout and data type information.

  • borderMode[in] Border mode to be used when accessing elements outside input image.

  • borderValue[in] Constant border value to be used when borderMode is NVCV_BORDER_CONSTANT. Ignored otherwise.

  • kernelCoefficients[in] Tensor handle containing the kernel coefficients. The kernel size is automatically extracted from the tensor dimensions.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Handle is null.

  • NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the operator.

  • NVCV_SUCCESS – Operation executed successfully.

NVCVStatus pvaConv2dSubmit(
NVCVOperatorHandle handle,
cupvaStream_t stream,
NVCVTensorHandle in,
NVCVTensorHandle out,
)#

Submits the Conv2d operator to a cuPVA stream.

Parameters:
  • handle[in] Handle to the operator.

    • Must not be NULL.

  • stream[in] Handle to a valid cuPVA stream.

  • in[in] Input tensor handle.

  • out[out] Output tensor handle.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.

  • NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.

  • NVCV_SUCCESS – Operation executed successfully.

NVCVStatus pvaConv2dSubmit(
NVCVOperatorHandle handle,
cudaStream_t stream,
NVCVTensorHandle in,
NVCVTensorHandle out,
)#

Submits the Conv2d operator to a CUDA stream.

Note

CUDA stream support requirements:

  • PVA SDK 2.7.0 or later

  • Jetpack 7 or later

  • DriveOS 7 or later

  • x86 Emulator is not supported

Parameters:
  • handle[in] Handle to the operator.

  • stream[in] Handle to a valid CUDA stream.

  • in[in] Input tensor handle.

  • out[out] Output tensor handle.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.

  • NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.

  • NVCV_SUCCESS – Operation executed successfully.