Main Content

Conditions for Code Replacement of Math Operators with HVX

Each math operators that can be used with the Support Package for Qualcomm Hexagon Processors requires specific conditions to allow code replacement by using the Qualcomm Hexagon Library (QHL). You use this code replacement when generating C/C++ code from a model or from MATLAB® code.

If you do not meet the specific requirements, then the generated C/C++ code runs on the Qualcomm Hexagon Processors. However, this generated code does not use library support.

The library supports these math operators only when you set specific properties, as indicated in this table:

 OperatorsInput RequirementsParameter RequirementsEquivalent Functions
1 add
  • Input can be vector/matrix

  • Real and Complex Values

  • Length should be >=1024 and a multiple of 32

  • Vector and matrix real inputs

    • qhblas_hvx_vector_add_af

  • Vector and matrix complex inputs

    • mw_qhblas_hvx_vector_add_acf

2sub (Fixed-Point Designer)
  • Input can be vector/matrix

  • Real and Complex Values

  • Length should be >=1024 and a multiple of 32

  • Vector and matrix real inputs

    • qhblas_vector_sub_af

  • Vector and matrix complex inputs

    • mw_qhblas_vector_sub_acf

3 Mul - elementwise
  • Input can be vector/matrix

  • Real Values

  • Length should be >=1024 and a multiple of 32

  • Vector and matrix real inputs

    • qhblas_hvx_vector_hadamard_af

4 Scaling
  • Input can be real/complex/vector/matrix

  • Scale factor has to be a real scalar

 
  • Vector and matrix real inputs

    • qhblas_hvx_vector_scaling_af

  • Vector and matrix complex inputs

    • mw_qhblas_hvx_vector_scaling_acf

5 Matrix Multiplication
  • Real Values

  • Input can be a vector/matrix

  • Matrix1 dimensions = m*n

  • Matrix2 dimensions = n*k

  • if RowMajor & k = 1 or ColMajor & m = 1

  • (2*n) - 1 >= 127 & m*k >= 4

    else

  • (2*n) - 1>= 15 & m*k >= 64

  • For Vector and Matrix real inputs

    • mw_qhblas_hvx_matrix_matrix_mpy_af

See Also

| | | | |

Related Topics