acldvppGaussianBlur

Applicability

Product

Supported

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function Usage

Description: performs Gaussian blur on images.

Prototype

Each operator has two-phase API calls. First, acldvppGaussianBlurGetWorkspaceSize is called to calculate the required workspace size based on the computation process. Then, acldvppGaussianBlur is called to perform computation. The two-phase APIs are as follows:

  • First-phase API:
    1
    acldvppStatus acldvppGaussianBlurGetWorkspaceSize(const aclTensor* self, const aclIntArray* kernelSize, const aclFloatArray* sigma, uint32_t paddingMode, aclTensor* out, uint64_t* workspaceSize, aclOpExecutor** executor)
    
  • Second-phase API:
    1
    acldvppStatus acldvppGaussianBlur(void* workspace, uint64_t workspaceSize, aclOpExecutor* executor, aclrtStream stream)
    

acldvppGaussianBlurGetWorkspaceSize

  • Parameters:
    • self: input tensor of the operator, which is of the aclTensor type created by calling aclCreateTensor (the tensor data is stored on the device). The value of dataType of the input tensor can be UINT8 or FLOAT, the value of Format can be NCHW or NHWC, and non-contiguous tensors are not supported. The value of N can be 1 or left empty, and the value of C can be 1 or 3 (1: input GRAY image; 3: input RGB image).
    • kernelSize: size of the Gaussian kernel. This parameter is an array whose length is 2. The first element in the array is the width, and the second element is the height. Both the width and height can only be set to 1, 3, or 5.
    • sigma: standard deviation of the Gaussian kernel. The value must be a positive number. This parameter is an array whose length is 2. The first element in the array is the standard deviation in the x direction, and the second element is the standard deviation in the y direction.
    • paddingMode: padding mode. The options are as follows:
      • 0: CONSTANT, indicating that a constant pad value will be used.
      • 2: REFLECT, indicating mirroring of boundary elements. The mirror does not include boundary elements themselves. For example, cb|abc****fgh|gf, where * indicates any image element.
    • out: output tensor of the operator, which is of the aclTensor type created by calling aclCreateTensor (the tensor data is stored on the device). The value of dataType of the output tensor can be UINT8 or FLOAT, the value of Format can be NCHW or NHWC, and non-contiguous tensors are not supported. The value of N can only be 1, the value of C can be 1 or 3 (1: GRAY image; 3: RGB image), and the values of dataType, Format and Shape must be the same as those of self.
    • workspaceSize: size of the workspace to be allocated on the device.
    • executor: operator executor, containing the operator computation process.
  • Returns:

    acldvppStatus status code. For details, see acldvpp Return Codes.

acldvppGaussianBlur

  • Parameters:
    • workspace: address of the device memory allocated by calling aclrtMalloc. The size of the device memory is specified by workspaceSize.
    • workspaceSize: The value must be the same as that obtained by calling acldvppGaussianBlurGetWorkspaceSize.
    • executor: op executor, which contains the operator computation process and is the same as the executor of the acldvppGaussianBlurGetWorkspaceSize API.
    • stream: stream for executing a task, which can be a created stream for saving resources or newly created by calling aclrtCreateStream.
  • Returns:

    acldvppStatus status code. For details, see acldvpp Return Codes.

Constraints

The supported image resolution ranges from 6 x 4 to 4096 x 8192.