[object Object][object Object][object Object]undefined
[object Object]
  • Description: Computes α multiplied by the product of A and B, and then adds the product of β and input C.
  • Formula:
    • If transA is not zero, A is transposed before computation. Similarly, if transB is not zero, B is transposed before computation.

      out=α(A@B)+βCout = α (A @ B) + β C
    • If both transA and transB are not zero, the formula is as follows:

      out=α(AT@BT)+βCout = α (A^T @ B^T) + βC
[object Object]

Each operator has calls. First, aclnnGemmGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnGemm is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:
      • The data type of A can be BFLOAT16, FLOAT16, or FLOAT32.
      • The data type of B can be BFLOAT16, FLOAT16, or FLOAT32.
      • The data type of C can be BFLOAT16, FLOAT16, or FLOAT32.
      • The data type of out can be BFLOAT16, FLOAT16, or FLOAT32.
      • When cubeMathType is set to 1, if the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, no processing is performed.
      • When cubeMathType is set to 2, this option is not supported if the input data type is BFLOAT16.
      • When cubeMathType is set to 3, if the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, this option is not supported.
    • [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]:
      • The data type of A can be FLOAT16 or FLOAT32.
      • The data type of B can be FLOAT16 or FLOAT32.
      • The data type of C can be FLOAT16 or FLOAT32.
      • The data type of out can be FLOAT16 or FLOAT32.
      • The data type BFLOAT16 is not supported.
      • When the input data type is FLOAT32, cubeMathType cannot be set to 0.
      • When cubeMathType is set to 1, if the input data type is FLOAT32, it is converted to FLOAT16 for computation. If the input data type is not FLOAT32, no processing is performed.
      • cubeMathType cannot be set to 3.
  • Returns:

    [object Object]: status code. For details, see .

The first-phase API implements input parameter validation. The following error codes may be returned. [object Object][object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object]Return[object Object] [object Object]Error Code[object Object] [object Object]Description[object Object] [object Object][object Object] [object Object] [object Object] [object Object]ACLNN_ERR_PARAM_NULLPTR[object Object] [object Object]161001[object Object] [object Object]The passed A, B, C, or out is a null pointer.[object Object] [object Object] [object Object] [object Object]ACLNN_ERR_PARAM_INVALID[object Object] [object Object]161002[object Object] [object Object]The data type or format is not supported.[object Object] [object Object] [object Object] [object Object]A or B is not 2D, or k is not the same between [m, k] and [k, n] in the shape during computation.[object Object] [object Object] [object Object] [object Object]The broadcast operation cannot be performed between self and batch1@batch2.[object Object] [object Object] [object Object] [object Object]The computation result of C and AB does not meet the broadcast relationship.[object Object] [object Object] [object Object] [object Object]The shape of out is inconsistent with that after A is multiplied by B.[object Object] [object Object] [object Object] [object Object]The value of cubeMathType is invalid.[object Object] [object Object] [object Object] [object Object]

[object Object]
  • Parameters:

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic description:

    • [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: The aclnnGemm function is implemented in a deterministic manner by default.
  • [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: The Cube unit does not support FLOAT32 computation. The input data type FLOAT32 can be converted to FLOAT16 in the API for computation by setting cubeMathType to 1 (ALLOW_FP32_DOWN_PRECISION).

[object Object]

The following example is for reference only. For details, see .

[object Object]