目录

FAST

Overview

Fast Algorithms Supported by Theory (FAST) Kit provides algorithm acceleration APIs to optimize metrics such as app startup time, loading speed, and response latency.

Since: 6.0.2(22)

Summary

This section describes the files, structs, macro definitions, type definitions, enums, and functions of FAST Kit.

[h2]Files

Name Description
fast_ads_segment_map.h Defines data structures and functions related to a Segment Map.
fast_ads_concurrent_hashmap.h Defines data structures and functions related to a concurrent hash map.
fast_common_def.h Defines common types in FAST Kit, such as error codes.
fast_dsp_common.h Defines the general data structures and utility functions for digital signal processing (DSP).
fast_dsp_transform.h Defines digital signal processing (DSP) transform functions, such as FFT and IFFT.
fast_solver_rect_partition.h Defines data structures and functions related to the Rectangular Partition Solver.
fast_solver_polynomial.h Defines data structures and functions related to the polynomial zero-finder.
fast_collections_hashmap.h Defines data structures and functions related to hash maps applicable to single-threaded scenarios.
fast_utils_algorithm.h General-purpose algorithm implementation, currently providing data structures and function definitions related to sorting.
scheduling_optimization.h Defines data structures and functions related to system performance optimization.

[h2]Structs

Name Description
struct FAST_Rect Defines the data structure of a rectangle.
struct FAST_Poly Defines the data structure for a sparse-format polynomial.
struct FAST_SplitComplex Defines the data structure of single-precision floating-point complex signals (split format).
struct FAST_SplitComplexD Defines the data structure of double-precision floating-point complex signals (split format).
struct FAST_BiquadCoefficients Defines the coefficients for a single-precision biquad IIR filter section.
struct FAST_BiquadCoefficientsD Defines the coefficients for a double-precision biquad IIR filter section.
struct FAST_BiquadState Defines the state variables for a single-precision biquad IIR filter section.
struct FAST_BiquadStateD Defines the state variables for a double-precision biquad IIR filter section.
struct FAST_Biquadm Defines the data structure for a single-precision, multi-channel, multi-section biquad IIR filter bank.
struct FAST_BiquadmD Defines the data structure for a double-precision, multi-channel, multi-section biquad IIR filter bank.
struct HMS_FAST_SortData Defines the data structure of a contiguous data block to be sorted.

[h2]Types

Name Description
typedef enum FAST_SegmentMapQueryType FAST_SegmentMapQueryType Enumerates the query types supported by a Segment Map.
typedef enum FAST_SegmentMapUpdateType FAST_SegmentMapUpdateType Enumerates the update types supported by a Segment Map.
typedef struct FAST_SegmentMapConfig FAST_SegmentMapConfig Defines the opaque configuration of a Segment Map.
typedef void * FAST_SegmentMapHandle Defines the handle to a Segment Map.
typedef enum FAST_ErrorCode FAST_ErrorCode Enumerates the error codes of FAST Kit.
typedef enum HMS_FAST_HannWindowType HMS_FAST_HannWindowType Enumerates the Hanning window types.
typedef struct FAST_Rect FAST_Rect Defines the data structure of a rectangle.
typedef struct FAST_Poly FAST_Poly Defines the data structure for a sparse-format polynomial.
typedef struct FAST_RectPartitionConfig FAST_RectPartitionConfig Defines the opaque configuration of the Rectangular Partition Solver.
typedef struct FAST_SplitComplex FAST_SplitComplex Defines the structure of a single-precision floating-point complex signal.
typedef struct FAST_SplitComplexD FAST_SplitComplexD Defines the structure of a double-precision floating-point complex signal.
typedef struct FAST_BiquadCoefficients FAST_BiquadCoefficients Defines the coefficients of a single-precision biquad IIR filter.
typedef struct FAST_BiquadCoefficientsD FAST_BiquadCoefficientsD Defines the coefficients of a double-precision biquad IIR filter.
typedef struct FAST_BiquadState FAST_BiquadState Defines the status of a single-precision biquad IIR filter.
typedef struct FAST_BiquadStateD FAST_BiquadStateD Defines the status of a double-precision biquad IIR filter.
typedef struct FAST_Biquadm FAST_Biquadm Defines the single-precision, multi-channel, multi-section IIR filter bank.
typedef struct FAST_BiquadmD FAST_BiquadmD Defines the double-precision, multi-channel, multi-section IIR filter bank.
typedef struct FAST_FFTConfig FAST_FFTConfig Defines the opaque configuration for FFT.
typedef void* FAST_HashmapHandle Defines the handle to a hash map.
typedef void* FAST_HashmapKeyPtr Defines the pointer to a hash map key.
typedef void* FAST_HashmapValuePtr Defines the pointer to a hash map value.
typedef uint64_t(* HMS_FAST_Hashmap_HashFunc) (const FAST_HashmapKeyPtr key) Defines a custom hash calculation function.
typedef int32_t(* HMS_FAST_Hashmap_KeyEqualFunc) (const FAST_HashmapKeyPtr leftKey, const FAST_HashmapKeyPtr rightKey) Defines a custom key comparison function.
typedef int32_t(* HMS_FAST_Hashmap_HookFunc) (const FAST_HashmapKeyPtr key, FAST_HashmapValuePtr value, void* context) Defines the custom general callback function format.
typedef void* FAST_ConcurrentHashmapHandle Defines the handle to a concurrent hash map.
typedef void* FAST_ConcurrentHashmapKeyPtr Defines the pointer to a concurrent hash map key.
typedef void* FAST_ConcurrentHashmapValuePtr Defines the pointer to a concurrent hash map value.
typedef uint64_t (*HMS_FAST_ConcurrentHashmap_HashFunc) (const FAST_ConcurrentHashmapKeyPtr key) Defines a custom hash calculation function.
typedef int32_t (*HMS_FAST_ConcurrentHashmap_KeyEqualFunc) (const FAST_ConcurrentHashmapKeyPtr leftKey, const FAST_ConcurrentHashmapKeyPtr rightKey) Defines the custom key comparison function.
typedef int32_t (*HMS_FAST_ConcurrentHashmap_HookFunc) (const FAST_ConcurrentHashmapKeyPtr key, FAST_ConcurrentHashmapValuePtr value, void* context) Defines the custom general callback function format.
typedef struct HMS_FAST_SortData HMS_FAST_SortData Defines the data structure of a contiguous data block to be sorted.
typedef void* HMS_FAST_SortElementPtr Defines the opaque pointer type of a single element in a generic container.
typedef const void* HMS_FAST_SortElementConstPtr Defines the const opaque pointer type of a single element in a generic container.
typedef int32_t(* HMS_FAST_Sort_CompFunc) (HMS_FAST_SortElementConstPtr first, HMS_FAST_SortElementConstPtr second) Defines the callback function pointer type for a user-defined comparison function.
typedef struct HMS_FAST_PerfHintConfigBuilder HMS_FAST_PerfHintConfigBuilder Defines the builder for system performance optimization configuration parameters.
typedef struct HMS_FAST_PerfHintConfig HMS_FAST_PerfHintConfig Defines the configuration parameters for system performance optimization.

[h2]Constants

Name Description
const uint32_t FAST_MAX_FFT_LOG2N = 16 Base-2 logarithm of the maximum number of points supported by the FFT. The value is 16, indicating that the maximum number of points is 65,536.

[h2]Enums

Name Description
FAST_SegmentMapQueryType { FAST_SEGMENTMAP_QUERY_TYPE_SUM = 0, FAST_SEGMENTMAP_QUERY_TYPE_MIN = 1, FAST_SEGMENTMAP_QUERY_TYPE_MAX = 2 } Enumerates the query types supported by a Segment Map.
FAST_SegmentMapUpdateType { FAST_SEGMENTMAP_UPDATE_TYPE_SET = 0, FAST_SEGMENTMAP_UPDATE_TYPE_ADD = 1, FAST_SEGMENTMAP_UPDATE_TYPE_SUB = 2 } Enumerates the update types supported by a Segment Map.

FAST_ErrorCode {

FAST_ERROR_CODE_SUCCESS = 1023100000, FAST_ERROR_CODE_FAIL = 1023100001, FAST_ERROR_CODE_ILLEGAL_INPUT = 1023100002, FAST_ERROR_CODE_INVALID_PTR = 1023100003,

FAST_ERROR_CODE_KEY_EXISTS = 1023110000, FAST_ERROR_CODE_KEY_NOT_EXISTS = 1023110001,

FAST_ERROR_CODE_OOM = 1023199001

}

Enumerates the error codes of FAST Kit.

HMS_FAST_HannWindowType {

HMS_FAST_HANN_DENORMALIZE_FULL = 0x00,

HMS_FAST_HANN_NORMALIZE_FULL = 0x01,

HMS_FAST_HANN_DENORMALIZE_HALF = 0x10,

HMS_FAST_HANN_NORMALIZE_HALF = 0x11

}

Enumerates the Hanning window types.

HMS_FAST_SchedulingOptimization_SceneType {

HMS_FAST_APP_LAUNCH = 1,

HMS_FAST_PAGE_TRANSITION = 2,

HMS_FAST_PAGE_LOAD = 3,

HMS_FAST_NETWORK_FILE_PROCESSING = 4,

HMS_FAST_LOCAL_FILE_PROCESSING = 5,

HMS_FAST_PAGE_DRAWING = 6,

HMS_FAST_ANIMATION = 7,

HMS_FAST_MEDIA_PLAYBACK = 8,

HMS_FAST_MEDIA_ENCODING_AND_DECODING = 9

}

Enumerates scenario types requiring system performance optimization.

HMS_FAST_SchedulingOptimization_SceneState {

HMS_FAST_END = 0,

HMS_FAST_BEGIN = 1

}

Enumerates scenario states for system performance optimization.

HMS_FAST_SchedulingOptimization_DurationType {

HMS_FAST_SHORT = 1,

HMS_FAST_MEDIUM = 2,

HMS_FAST_LONG = 3

}

Enumerates duration options for system performance optimization.

HMS_FAST_SchedulingOptimization_ErrorCode {

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS = 0,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_HIGH_SYSTEM_LOAD = 1027700001,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_POWER_SAVING_MODE = 1027700002,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_LOW_POWER_MODE = 1027700003,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_NON_FRONTEND = 1027700004,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INTERVAL = 1027700005,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_EXECUTE_ERROR = 1027700006,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM = 1027700007,

HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_NO_MEMORY = 1027700008

}

Enumerates error codes for system performance optimization.

[h2]Functions

Name Description
FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_CreateConfig (FAST_SegmentMapConfig **config) Creates an opaque configuration instance for a Segment Map.
FAST_EXPORT void HMS_FAST_SegmentMap_DestroyConfig (FAST_SegmentMapConfig *config) Destroys an opaque configuration instance of a Segment Map and deallocates memory.
FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_SetQueryType (FAST_SegmentMapConfig *config, FAST_SegmentMapQueryType type) Sets the query type in the opaque configuration of a Segment Map.
FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_SetUpdateType (FAST_SegmentMapConfig *config, FAST_SegmentMapUpdateType type) Sets the update type in the opaque configuration of a Segment Map.
FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_Create (FAST_SegmentMapHandle *handle, size_t size, const int32_t *array, FAST_SegmentMapConfig *config) Creates a Segment Map.
FAST_EXPORT void HMS_FAST_SegmentMap_Destroy (FAST_SegmentMapHandle handle) Destroys a Segment Map instance.
FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_Update (FAST_SegmentMapHandle handle, size_t left, size_t right, int32_t value) Performs a range update on a Segment Map.
FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_Query (FAST_SegmentMapHandle handle, size_t left, size_t right, int32_t *result) Performs a range query on a Segment Map.
FAST_EXPORT FAST_ErrorCode HMS_FAST_RectPartition_CreateConfig (FAST_RectPartitionConfig **config) Creates the opaque configuration of the Rectangular Partition Solver.
FAST_EXPORT void HMS_FAST_RectPartition_DestroyConfig (FAST_RectPartitionConfig *config) Destroys the opaque configuration of the Rectangular Partition Solver.
FAST_EXPORT FAST_ErrorCode HMS_FAST_RectPartition_SetAlgo (FAST_RectPartitionConfig *config, const char *name) Sets the algorithm used by the Rectangular Partition Solver. Currently, only the SweepLineAlgo scanline algorithm is supported. It outputs a set of non-overlapping rectangles with as few rectangles as possible (without guaranteeing optimality). The time complexity is .
FAST_EXPORT FAST_ErrorCode HMS_FAST_RectPartition_Solve (FAST_RectPartitionConfig *config, size_t size, const FAST_Rect *origin, FAST_Rect *result, size_t *resultSize)

Solves the rectangular partition problem under the specified opaque configuration. The function takes a set of non-overlapping rectangles as input and computes a rectangular partitioning scheme to generate a minimum number of rectangles that cover the same total area.

Note:

1. The input rectangles must be pairwise non-overlapping (that is, for any two rectangles, at least one of the following conditions must be satisfied: , , , or . Otherwise, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

2. The function must ensure that the number of output rectangles is less than or equal to the number of input rectangles.

FAST_ErrorCode HMS_FAST_PolyRoot_ComputeRoots (const FAST_Poly *poly, const size_t maxRootCount, double *root, size_t *rootCount) Computes a specified number of real roots of the polynomial.
FAST_ErrorCode HMS_FAST_PolyRoot_ComputeSingle (const FAST_Poly *poly, double *root) Computes the real root of the polynomial with the largest absolute value.
FAST_ErrorCode HMS_FAST_PolyRoot_ComputeRootIntervals (const FAST_Poly *poly, const size_t maxRootCount, double *leftBoundary, double *rightBoundary, size_t *rootCount) Computes the isolation intervals for a specified number of real roots of a polynomial, outputting the left and right bounds of each real root.
float HMS_FAST_DSP_Maxmgv (const float *input, size_t stride, size_t length) Computes the maximum magnitude of a strided real vector (single-precision).
double HMS_FAST_DSP_MaxmgvD (const double *input, size_t stride, size_t length) Computes the maximum magnitude of a strided real vector (double-precision).
void HMS_FAST_DSP_Maxvi (const float *input, size_t stride, size_t length, float *value, size_t *index) Finds the maximum value and its index in a strided real vector (single-precision).
void HMS_FAST_DSP_MaxviD (const double *input, size_t stride, size_t length, double *value, size_t *index) Finds the maximum value and its index in a strided real vector (double-precision).
float HMS_FAST_DSP_Sve (const float *input, size_t stride, size_t length) Computes the sum of a strided real vector (single-precision).
double HMS_FAST_DSP_SveD (const double *input, size_t stride, size_t length) Computes the sum of a strided real vector (double-precision).
float HMS_FAST_DSP_Svemg (const float *input, size_t stride, size_t length) Computes the sum of absolute values (L1 norm) of a strided vector (single-precision).
double HMS_FAST_DSP_SvemgD (const double *input, size_t stride, size_t length) Computes the sum of absolute values (L1 norm) of a strided vector (double-precision).
float HMS_FAST_DSP_Meamgv (const float *input, size_t stride, size_t length) Computes the mean of absolute values of a strided real vector (single-precision).
double HMS_FAST_DSP_MeamgvD (const double *input, size_t stride, size_t length) Computes the mean of absolute values of a strided real vector (double-precision).
float HMS_FAST_DSP_Dotpr (const float *inputA, size_t strideA, const float *inputB, size_t strideB, size_t length) Computes the dot product of two strided real vectors (single-precision).
double HMS_FAST_DSP_DotprD (const double *inputA, size_t strideA, const double *inputB, size_t strideB, size_t length) Computes the dot product of two strided real vectors (double-precision).
void HMS_FAST_DSP_Vsbsm (const float *inputA, size_t strideA, const float *inputB, size_t strideB, float scalar, float *outputC, size_t strideC, size_t length) Performs vector subtraction: outputC[i] = (inputA[i] - inputB[i]) * scalar (single-precision).
void HMS_FAST_DSP_VsbsmD (const double *inputA, size_t strideA, const double *inputB, size_t strideB, double scalar, double *outputC, size_t strideC, size_t length) Performs vector subtraction: outputC[i] = (inputA[i] - inputB[i]) * scalar (double-precision).
void HMS_FAST_DSP_Ctoz (const float *input, size_t strideInput, FAST_SplitComplex *output, size_t strideOutput, size_t length) Converts an interleaved complex array to the split format (single-precision).
void HMS_FAST_DSP_CtozD (const double *input, size_t strideInput, FAST_SplitComplexD *output, size_t strideOutput, size_t length) Converts an interleaved complex array to the split format (double-precision).
void HMS_FAST_DSP_Ztoc (const FAST_SplitComplex *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Converts a split complex array to the interleaved format (single-precision).
void HMS_FAST_DSP_ZtocD (const FAST_SplitComplexD *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Converts a split complex array to the interleaved format (double-precision).
void HMS_FAST_DSP_Zvabs (const FAST_SplitComplex *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Computes the magnitude of a complex vector (single-precision).
void HMS_FAST_DSP_ZvabsD (const FAST_SplitComplexD *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Computes the magnitude of a complex vector (double-precision).
void HMS_FAST_DSP_Zvmags (const FAST_SplitComplex *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Computes the squared magnitude of a complex vector (single-precision).
void HMS_FAST_DSP_ZvmagsD (const FAST_SplitComplexD *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Computes the squared magnitude of a complex vector (double-precision).
void HMS_FAST_DSP_Zvphas (const FAST_SplitComplex *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Computes the phase angles of a complex vector (single-precision).
void HMS_FAST_DSP_ZvphasD (const FAST_SplitComplexD *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Computes the phase angles of a complex vector (double-precision).
void HMS_FAST_DSP_Vsmul (const float *input, size_t strideInput, const float scalar, float *output, size_t strideOutput, size_t length) Multiplies each element of a vector by a scalar (single-precision).
void HMS_FAST_DSP_VsmulD (const double *input, size_t strideInput, const double scalar, double *output, size_t strideOutput, size_t length) Multiplies each element of a vector by a scalar (double-precision).
void HMS_FAST_DSP_Vsdiv (const float *input, size_t strideInput, const float scalar, float *output, size_t strideOutput, size_t length) Divides each element of a vector by a scalar (single-precision).
void HMS_FAST_DSP_VsdivD (const double *input, size_t strideInput, const double scalar, double *output, size_t strideOutput, size_t length) Divides each element of a vector by a scalar (double-precision).
void HMS_FAST_DSP_Svdiv (const float scalar, const float *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Divides a scalar by each element of a vector (single-precision).
void HMS_FAST_DSP_SvdivD (const double scalar, const double *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Divides a scalar by each element of a vector (double-precision).
void HMS_FAST_DSP_Vsadd (const float *input, size_t strideInput, const float scalar, float *output, size_t strideOutput, size_t length) Adds a scalar to each element of a vector (single-precision).
void HMS_FAST_DSP_VsaddD (const double *input, size_t strideInput, const double scalar, double *output, size_t strideOutput, size_t length) Adds a scalar to each element of a vector (double-precision).
void HMS_FAST_DSP_Vadd (const float *inputA, size_t strideA, const float *inputB, size_t strideB, float *outputC, size_t strideC, size_t length) Performs element-wise vector addition (single-precision).
void HMS_FAST_DSP_VaddD (const double *inputA, size_t strideA, const double *inputB, size_t strideB, double *outputC, size_t strideC, size_t length) Performs element-wise vector addition (double-precision).
void HMS_FAST_DSP_Vsub (const float *inputA, size_t strideA, const float *inputB, size_t strideB, float *outputC, size_t strideC, size_t length) Performs element-wise vector subtraction (single-precision).
void HMS_FAST_DSP_VsubD (const double *inputA, size_t strideA, const double *inputB, size_t strideB, double *outputC, size_t strideC, size_t length) Performs element-wise vector subtraction (double-precision).
void HMS_FAST_DSP_Vmul (const float *inputA, size_t strideA, const float *inputB, size_t strideB, float *outputC, size_t strideC, size_t length) Performs element-wise vector multiplication (single-precision).
void HMS_FAST_DSP_VmulD (const double *inputA, size_t strideA, const double *inputB, size_t strideB, double *outputC, size_t strideC, size_t length) Performs element-wise vector multiplication (double-precision).
void HMS_FAST_DSP_Vdiv (const float *inputA, size_t strideA, const float *inputB, size_t strideB, float *outputC, size_t strideC, size_t length) Performs element-wise vector division (single-precision).
void HMS_FAST_DSP_VdivD (const double *inputA, size_t strideA, const double *inputB, size_t strideB, double *outputC, size_t strideC, size_t length) Performs element-wise vector division (double-precision).
void HMS_FAST_DSP_Vdist (const float *inputA, size_t strideA, const float *inputB, size_t strideB, float *outputC, size_t strideC, size_t length) Computes the element-wise Euclidean norm of two vectors (single-precision).
void HMS_FAST_DSP_VdistD (const double *inputA, size_t strideA, const double *inputB, size_t strideB, double *outputC, size_t strideC, size_t length) Computes the element-wise Euclidean norm of two vectors (double-precision).
float HMS_FAST_DSP_Svesq (const float *input, size_t stride, size_t length) Computes the sum of squares of vector elements (single-precision).
double HMS_FAST_DSP_SvesqD (const double *input, size_t stride, size_t length) Computes the sum of squares of vector elements (double-precision).
void HMS_FAST_DSP_Minvi (const float *input, size_t stride, size_t length, float *value, size_t *index) Finds the minimum value and its index in a strided real vector (single-precision).
void HMS_FAST_DSP_MinviD (const double *input, size_t stride, size_t length, double *value, size_t *index) Finds the minimum value and its index in a strided real vector (double-precision).
void HMS_FAST_DSP_Vsq (const float *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Computes the square of each vector element (single-precision).
void HMS_FAST_DSP_VsqD (const double *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Computes the square of each vector element (double-precision).
void HMS_FAST_DSP_Vabs (const float *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Computes the absolute value of each vector element (single-precision).
void HMS_FAST_DSP_VabsD (const double *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Computes the absolute value of each vector element (double-precision).
void HMS_FAST_DSP_Vthr (const float *input, size_t strideInput, const float threshold, float *output, size_t strideOutput, size_t length) Applies a threshold to a vector (single-precision).
void HMS_FAST_DSP_VthrD (const double *input, size_t strideInput, const double threshold, double *output, size_t strideOutput, size_t length) Applies a threshold to a vector (double-precision).
void HMS_FAST_DSP_Vrvrs (float *vector, size_t stride, size_t length) Reverses the order of vector elements in place (single-precision).
void HMS_FAST_DSP_VrvrsD (double *vector, size_t stride, size_t length) Reverses the order of vector elements in place (double-precision).
void HMS_FAST_DSP_Vspdp (const float *input, size_t strideInput, double *output, size_t strideOutput, size_t length) Converts a single-precision vector to a double-precision vector.
void HMS_FAST_DSP_Vdpsp (const double *input, size_t strideInput, float *output, size_t strideOutput, size_t length) Converts a double-precision vector to a single-precision vector.
void HMS_FAST_DSP_Vfill (float *vector, size_t stride, size_t length, const float scalar) Fills a vector with a specified scalar value (single-precision).
void HMS_FAST_DSP_VfillD (double *vector, size_t stride, size_t length, const double scalar) Fills a vector with a specified scalar value (double-precision).
void HMS_FAST_DSP_Vclr (float *vector, size_t stride, size_t length) Clears all elements in a vector (single-precision).
void HMS_FAST_DSP_VclrD (double *vector, size_t stride, size_t length) Clears all elements in a vector (double-precision).
void HMS_FAST_DSP_Conv (const float *input, size_t strideInput, const float *filter, size_t strideFilter, float *output, size_t strideOutput, size_t outputLength, size_t filterLength) Performs convolution on two vectors (single-precision).
void HMS_FAST_DSP_ConvD (const double *input, size_t strideInput, const double *filter, size_t strideFilter, double *output, size_t strideOutput, size_t outputLength, size_t filterLength) Performs convolution on two vectors (double-precision).
void HMS_FAST_DSP_HannWindow (float *output, size_t length, HMS_FAST_HannWindowType type) Generates a Hanning window sequence (single-precision).
void HMS_FAST_DSP_HannWindowD (double *output, size_t length, HMS_FAST_HannWindowType type) Generates a Hanning window sequence (double-precision).
void HMS_FAST_DSP_Mmul (const float *matrixA, size_t strideA, const float *matrixB, size_t strideB, float *matrixC, size_t strideC, size_t rowsM, size_t colsN, size_t colsP) Performs matrix multiplication: C = A * B (single-precision).
void HMS_FAST_DSP_MmulD (const double *matrixA, size_t strideA, const double *matrixB, size_t strideB, double *matrixC, size_t strideC, size_t rowsM, size_t colsN, size_t colsP) Performs matrix multiplication: C = A * B (double-precision).
void HMS_FAST_DSP_Vvpow (const float *inputA, const float *inputB, float *outputC, size_t length) Performs element-wise vector power operation (single-precision).
void HMS_FAST_DSP_VvpowD (const double *inputA, const double *inputB, double *outputC, size_t length) Performs element-wise vector power operation (double-precision).
void HMS_FAST_DSP_Vsort (float *vector, size_t length, int order) Sorts vectors in place (single-precision).
void HMS_FAST_DSP_VsortD (double *vector, size_t length, int order) Sorts vectors in place (double-precision).
FAST_ErrorCode HMS_FAST_Biquadm_SetActiveFilters (FAST_Biquadm *filter, const uint8_t *activeMask) Sets the activation mask for biquad filter sections (single-precision).
FAST_ErrorCode HMS_FAST_Biquadm_SetActiveFiltersD (FAST_BiquadmD *filter, const uint8_t *activeMask) Sets the activation mask for biquad filter sections (double-precision).
FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffSingle (FAST_Biquadm *filter, const float *coeff, size_t stride) Sets all biquad filter coefficients from a single-precision source array (single-precision filter).
FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffDouble (FAST_Biquadm *filter, const double *coeff, size_t stride) Sets all biquad filter coefficients from a double-precision source array (single-precision filter).
FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffSingleD (FAST_BiquadmD *filter, const float *coeff, size_t stride) Sets all biquad filter coefficients from a single-precision source array (double-precision filter).
FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffDoubleD (FAST_BiquadmD *filter, const double *coeff, size_t stride) Sets all biquad filter coefficients from a double-precision source array (double-precision filter).
FAST_ErrorCode HMS_FAST_Biquadm_Create (size_t numChannels, size_t numSections, size_t maxFrames, FAST_Biquadm **filter) Creates and initializes a multi-channel, multi-section biquad IIR filter bank (single-precision).
FAST_ErrorCode HMS_FAST_Biquadm_CreateD (size_t numChannels, size_t numSections, size_t maxFrames, FAST_BiquadmD **filter) Creates and initializes a multi-channel, multi-section biquad IIR filter bank (double-precision).
void HMS_FAST_Biquadm_Destroy (FAST_Biquadm *filter) Destroys a biquad filter instance (single-precision).
void HMS_FAST_Biquadm_DestroyD (FAST_BiquadmD *filter) Destroys a biquad filter instance (double-precision).
FAST_ErrorCode HMS_FAST_Biquadm (FAST_Biquadm *filter, const float **input, const size_t strideInput, float **output, const size_t strideOutput, size_t length) Processes multi-channel audio through a biquad filter bank (single-precision).
FAST_ErrorCode HMS_FAST_BiquadmD (FAST_BiquadmD *filter, const double **input, const size_t strideInput, double **output, const size_t strideOutput, size_t length) Processes multi-channel audio through a biquad filter bank (double-precision).
FAST_ErrorCode HMS_FAST_FFT_CreateConfig (FAST_FFTConfig** config, const uint32_t log2n) Creates a single-precision FFT configuration object. log2n is the base-2 logarithm of the number of FFT points and must satisfy 0 < log2n <= FAST_MAX_FFT_LOG2N (that is, 1 to 16).
FAST_ErrorCode HMS_FAST_FFT_CreateConfigD (FAST_FFTConfig** config, const uint32_t log2n) Creates a double-precision FFT configuration object. log2n is the base-2 logarithm of the number of FFT points and must satisfy 0 < log2n <= FAST_MAX_FFT_LOG2N (that is, 1 to 16).
void HMS_FAST_FFT_DestroyConfig (FAST_FFTConfig* config) Destroys an FFT configuration object and releases its resources.
FAST_ErrorCode HMS_FAST_FFT_ForwardTransform (FAST_FFTConfig* config, const uint32_t length, const float input[], float outputRe[], float outputIm[]) Computes the DFT of a single-precision, real-valued time-domain signal.
FAST_ErrorCode HMS_FAST_FFT_ForwardTransformD (FAST_FFTConfig* config, const uint32_t length, const double input[], double outputRe[], double outputIm[]) Computes the DFT of a double-precision, real-valued time-domain signal.
FAST_ErrorCode HMS_FAST_FFT_InverseTransform (FAST_FFTConfig* config, const uint32_t length, const float inputRe[], const float inputIm[], float output[]) Computes the inverse DFT of a single-precision, complex-valued frequency-domain sequence.
FAST_ErrorCode HMS_FAST_FFT_InverseTransformD (FAST_FFTConfig* config, const uint32_t length, const double inputRe[], const double inputIm[], double output[]) Computes the inverse DFT of a double-precision, complex-valued frequency-domain sequence.
FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Create (FAST_ConcurrentHashmapHandle* handle, HMS_FAST_ConcurrentHashmap_HashFunc hasher, HMS_FAST_ConcurrentHashmap_KeyEqualFunc equaler, float maxLoadFac, size_t numShards) Creates a concurrent hash map with the given configuration.
void HMS_FAST_ConcurrentHashmap_Destroy (FAST_ConcurrentHashmapHandle handle) Destroys a specified concurrent hash map.
FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Insert (FAST_ConcurrentHashmapHandle handle, const FAST_ConcurrentHashmapKeyPtr key, const FAST_ConcurrentHashmapValuePtr value, FAST_ConcurrentHashmapValuePtr* originValue) Inserts a given key-value pair into a concurrent hash map. If the key already exists, overwrites the existing value with the new value and saves the address of the original value into originValue.
FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Find (FAST_ConcurrentHashmapHandle handle, const FAST_ConcurrentHashmapKeyPtr key, FAST_ConcurrentHashmapValuePtr* value) Searches for the input key in a given concurrent hash map and saves the corresponding value into value.
FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Erase (FAST_ConcurrentHashmapHandle handle, const FAST_ConcurrentHashmapKeyPtr key, FAST_ConcurrentHashmapKeyPtr* originKey, FAST_ConcurrentHashmapValuePtr* originValue) Deletes the input key from the given hash map and saves the key and its value into originKey and originValue, respectively.
FAST_ErrorCode HMS_FAST_ConcurrentHashmap_TryInsert (FAST_ConcurrentHashmapHandle handle, const FAST_ConcurrentHashmapKeyPtr key, const FAST_ConcurrentHashmapValuePtr value) Inserts a given key-value pair into a concurrent hash map. If the key already exists, no operation is performed.
size_t HMS_FAST_ConcurrentHashmap_Size (FAST_ConcurrentHashmapHandle handle) Returns the number of elements in a given hash map.
void HMS_FAST_ConcurrentHashmap_Clear (FAST_ConcurrentHashmapHandle handle) Clears all elements maintained in a given hash map.
size_t HMS_FAST_ConcurrentHashmap_EraseIf (FAST_ConcurrentHashmapHandle handle, HMS_FAST_ConcurrentHashmap_HookFunc condFunc, void* condCtx, HMS_FAST_ConcurrentHashmap_HookFunc freeFunc, void* freeCtx) Deletes all elements that meet the specified conditions from the hash map and releases the memory in the custom manner.
void HMS_FAST_ConcurrentHashmap_Traverse (FAST_ConcurrentHashmapHandle handle, HMS_FAST_ConcurrentHashmap_HookFunc condFunc, void* condCtx, HMS_FAST_ConcurrentHashmap_HookFunc workFunc, void* workCtx) Traverses the hash map and modifies all key-value pairs that meet the specified conditions in the custom manner.
FAST_ErrorCode HMS_FAST_Hashmap_Create (FAST_HashmapHandle* handle, HMS_FAST_Hashmap_HashFunc hasher, HMS_FAST_Hashmap_KeyEqualFunc equaler) Creates a hash map instance.
void HMS_FAST_Hashmap_Destroy (FAST_HashmapHandle handle) Destroys a hash map instance.
FAST_ErrorCode HMS_FAST_Hashmap_Insert (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, const FAST_HashmapValuePtr value, FAST_HashmapValuePtr* originValue) Inserts a given key-value pair into a hash map. If the key already exists, overwrites the existing value with the new value and saves the address of the original value into originValue.
FAST_ErrorCode HMS_FAST_Hashmap_Find (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, FAST_HashmapValuePtr* value) Retrieves the value associated with the given key and stores the value in value.
FAST_ErrorCode HMS_FAST_Hashmap_Erase (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, FAST_HashmapKeyPtr* originKey, FAST_HashmapValuePtr* originValue) Deletes the input key from the given hash map and saves the addresses of the corresponding key and value into originKey and originValue, respectively.
FAST_ErrorCode HMS_FAST_Hashmap_TryInsert (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, const FAST_HashmapValuePtr value) Inserts a given key-value pair into a hash map. If the key already exists, no operation is performed.
size_t HMS_FAST_Hashmap_Size (FAST_HashmapHandle handle) Returns the number of elements in a hash map.
void HMS_FAST_Hashmap_Clear (FAST_HashmapHandle handle) Deletes all elements from a hash map.
size_t HMS_FAST_Hashmap_EraseIf (FAST_HashmapHandle handle, HMS_FAST_Hashmap_HookFunc condFunc, void* condCtx, HMS_FAST_Hashmap_HookFunc freeFunc, void* freeCtx) Deletes all elements that meet the specified conditions from a hash map and releases the memory in the custom manner.
void HMS_FAST_Hashmap_Traverse (FAST_HashmapHandle handle, HMS_FAST_Hashmap_HookFunc condFunc, void* condCtx, HMS_FAST_Hashmap_HookFunc workFunc, void* workCtx) Traverses a hash map and modifies all key-value pairs that meet the specified conditions in a custom manner.
FAST_ErrorCode HMS_FAST_Algo_Sort (HMS_FAST_SortData *data, HMS_FAST_Sort_CompFunc comp) Fully sorts an array of arbitrary type using a user-provided comparison function.
FAST_ErrorCode HMS_FAST_Algo_PartialSortAt (HMS_FAST_SortData *data, size_t offset, size_t count, HMS_FAST_Sort_CompFunc comp) Performs an in-place partial sort on an array, making the specified range correspond to a sorted segment.
FAST_ErrorCode HMS_FAST_Algo_NaturalSort (HMS_FAST_SortData *data, int32_t ascend) Sorts an array of UTF-8 strings using natural language rules.
FAST_ErrorCode HMS_FAST_Algo_NaturalPartialSortAt (HMS_FAST_SortData *data, size_t offset, size_t count, int32_t ascend) Partially sorts an array of UTF-8 strings using natural language rules, making the specified range correspond to a sorted segment.
HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_Create (HMS_FAST_PerfHintConfigBuilder** builder) Creates a builder instance.
void HMS_FAST_PerfHintConfigBuilder_Destroy (HMS_FAST_PerfHintConfigBuilder* builder) Destroys a builder.
HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetSceneType (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_SchedulingOptimization_SceneType sceneType) Sets the scenario type requiring system performance optimization.
HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetSceneState (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_SchedulingOptimization_SceneState sceneState) Sets the scenario state for system performance optimization.
HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetDurationType (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_SchedulingOptimization_DurationType durationType) Sets the duration for system performance optimization.
HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetTids (HMS_FAST_PerfHintConfigBuilder* builder, int* tids, uint32_t tidsSize) Sets the IDs of the threads to be optimized.
HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_Build (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_PerfHintConfig** config) Creates configuration parameters for system performance optimization.
void HMS_FAST_PerfHintConfig_Destroy (HMS_FAST_PerfHintConfig* config) Destroys configuration parameters for system performance optimization.
HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_SchedulingOptimization_PerfHint (const HMS_FAST_PerfHintConfig* config) System performance optimization API.

Type Definition Description

[h2]FAST_ErrorCode

typedef enum FAST_ErrorCode FAST_ErrorCode

Description

Enumerates the error codes of FAST Kit.

Since: 6.0.2(22)

[h2]FAST_Rect

typedef struct FAST_Rect FAST_Rect

Description

Defines the data structure of a rectangle.

Since: 6.0.2(22)

[h2]FAST_RectPartitionConfig

typedef struct FAST_RectPartitionConfig FAST_RectPartitionConfig

Description

Defines the opaque configuration of the Rectangular Partition Solver. If no algorithm is set in the configuration, the default algorithm SweepLineAlgo is used.

Since: 6.0.2(22)

[h2]FAST_Poly

typedef struct FAST_Poly FAST_Poly

Description

Defines the data structure for a sparse-format polynomial. The polynomial is represented by a coefficient array coeff and an exponent array pow, and must be sorted in ascending order of exponents.

Since: 26.0.0

[h2]FAST_SegmentMapConfig

typedef struct FAST_SegmentMapConfig FAST_SegmentMapConfig

Description

Defines the opaque configuration of a Segment Map.

Since: 6.0.2(22)

[h2]FAST_SegmentMapHandle

typedef void* FAST_SegmentMapHandle

Description

Defines the handle to a Segment Map.

Since: 6.0.2(22)

[h2]FAST_SegmentMapQueryType

typedef enum FAST_SegmentMapQueryType FAST_SegmentMapQueryType

Description

Defines the range query types supported by the Segment Map data structure.

Since: 6.0.2(22)

[h2]FAST_SegmentMapUpdateType

typedef enum FAST_SegmentMapUpdateType FAST_SegmentMapUpdateType

Description

Defines the range update types supported by the Segment Map data structure.

Since: 6.0.2(22)

[h2]FAST_ConcurrentHashmapHandle

typedef void* FAST_ConcurrentHashmapHandle

Description

Defines the handle to a concurrent hash map.

Since: 6.1.1(24)

[h2]FAST_ConcurrentHashmapKeyPtr

typedef void* FAST_ConcurrentHashmapKeyPtr

Description

Defines the pointer to a concurrent hash map key.

Since: 6.1.1(24)

[h2]FAST_ConcurrentHashmapValuePtr

typedef void* FAST_ConcurrentHashmapValuePtr

Description

Defines the pointer to a concurrent hash map value.

Since: 6.1.1(24)

[h2]HMS_FAST_ConcurrentHashmap_HashFunc

typedef uint64_t (*HMS_FAST_ConcurrentHashmap_HashFunc)(const FAST_ConcurrentHashmapKeyPtr key)

Description

Defines the callback function type for calculating the hash value of a concurrent hash map.

Since: 6.1.1(24)

[h2]HMS_FAST_ConcurrentHashmap_KeyEqualFunc

typedef int32_t (*HMS_FAST_ConcurrentHashmap_KeyEqualFunc)(
    const FAST_ConcurrentHashmapKeyPtr leftKey,
    const FAST_ConcurrentHashmapKeyPtr rightKey
)

Description

Defines the callback function type for comparing keys in a concurrent hash map.

Since: 6.1.1(24)

[h2]HMS_FAST_ConcurrentHashmap_HookFunc

typedef int32_t (*HMS_FAST_ConcurrentHashmap_HookFunc)(
    const FAST_ConcurrentHashmapKeyPtr key,
    FAST_ConcurrentHashmapValuePtr value,
    void* context
)

Description

Defines the general callback function of a concurrent hash map.

Since: 6.1.1(24)

[h2]FAST_SplitComplex

typedef struct FAST_SplitComplex FAST_SplitComplex

Description

Defines the data structure of single-precision floating-point complex signals (split format: real and imaginary parts stored separately).

Since: 6.1.1(24)

[h2]FAST_SplitComplexD

typedef struct FAST_SplitComplexD FAST_SplitComplexD

Description

Defines the data structure of double-precision floating-point complex signals (split format: real and imaginary parts stored separately).

Since: 6.1.1(24)

[h2]FAST_BiquadCoefficients

typedef struct FAST_BiquadCoefficients FAST_BiquadCoefficients

Description

Defines the coefficients for a single-precision biquad IIR filter section (direct form I or II). Transfer function: H(z) = (b0 + b1z⁻¹ + b2z⁻²) / (1 + a1z⁻¹ + a2z⁻²). 1 in the denominator is actually the result of normalizing coefficient a0.

Since: 6.1.1(24)

[h2]FAST_BiquadCoefficientsD

typedef struct FAST_BiquadCoefficientsD FAST_BiquadCoefficientsD

Description

Defines the coefficients for a double-precision biquad IIR filter section (direct form I or II). Transfer function: H(z) = (b0 + b1z⁻¹ + b2z⁻²) / (1 + a1z⁻¹ + a2z⁻²). 1 in the denominator is actually the result of normalizing coefficient a0.

Since: 6.1.1(24)

[h2]FAST_BiquadState

typedef struct FAST_BiquadState FAST_BiquadState

Description

Defines the state variables for a single-precision biquad IIR filter section.

Since: 6.1.1(24)

[h2]FAST_BiquadStateD

typedef struct FAST_BiquadStateD FAST_BiquadStateD

Description

Defines the state variables for a double-precision biquad IIR filter section.

Since: 6.1.1(24)

[h2]FAST_Biquadm

typedef struct FAST_Biquadm FAST_Biquadm

Description

Defines the data structure for a single-precision, multi-channel, multi-section biquad IIR filter bank.

Since: 6.1.1(24)

[h2]FAST_BiquadmD

typedef struct FAST_BiquadmD FAST_BiquadmD

Description

Defines the data structure for a double-precision, multi-channel, multi-section biquad IIR filter bank.

Since: 6.1.1(24)

[h2]FAST_FFTConfig

typedef struct FAST_FFTConfig FAST_FFTConfig

Description

Defines the opaque configuration for FFT. This object is not thread-safe. In a multi-threaded environment, concurrent operations on the same FAST_FFTConfig object by multiple threads are strictly prohibited.

Since: 26.0.0

[h2]FAST_HashmapHandle

typedef void* FAST_HashmapHandle

Defines the handle to a hash map.

Since: 26.0.0

[h2]FAST_HashmapKeyPtr

typedef void* FAST_HashmapKeyPtr

Description

Defines the pointer to a hash map key.

Since: 26.0.0

[h2]FAST_HashmapValuePtr

typedef void* FAST_HashmapValuePtr

Description

Defines the pointer to a hash map value.

Since: 26.0.0

[h2]HMS_FAST_Hashmap_HashFunc

typedef uint64_t(* HMS_FAST_Hashmap_HashFunc) (const FAST_HashmapKeyPtr key)

Description

Defines the callback function type for calculating the hash value of a hash map.

Since: 26.0.0

Parameters:

Name Description
key FAST_HashmapKeyPtr for which the hash value is to be calculated.

Returns:

64-bit hash value derived from the key.

[h2]HMS_FAST_Hashmap_HookFunc

typedef int32_t(* HMS_FAST_Hashmap_HookFunc) (const FAST_HashmapKeyPtr key, FAST_HashmapValuePtr value, void* context)

Description

Defines the general callback function of a hash map.

Since: 26.0.0

Parameters:

Name Description
key Key of the current element being accessed.
value Value of the key.
context User-defined context passed through the traversal API.

Returns:

If the condition is met (for example, for filtering) is met, a non-zero value is returned. Otherwise, zero is returned.

NOTE

This function is typically used in APIs that support conditional processing, such as selective deletion or transformation. The exact interpretation of the return value depends on the calling function:

[h2]HMS_FAST_Hashmap_KeyEqualFunc

typedef int32_t(* HMS_FAST_Hashmap_KeyEqualFunc) (const FAST_HashmapKeyPtr leftKey, const FAST_HashmapKeyPtr rightKey)

Description

Defines a custom callback for the key equality comparison function.

Since: 26.0.0

Parameters:

Name Description
leftKey Pointer to a key within the hash map, passed as the left operand for the equality comparison.
rightKey Pointer to another key within the hash map, passed as the right operand for the equality comparison.

Returns:

If the keys are considered equal, a non-zero value is returned. Otherwise, zero is returned.

[h2]HMS_FAST_SortElementPtr

typedef void* HMS_FAST_SortElementPtr

Description

Defines the opaque pointer type of a single element in a generic container.

Since: 26.0.0

[h2]HMS_FAST_SortElementConstPtr

typedef const void* HMS_FAST_SortElementConstPtr

Description

Defines the const opaque pointer type of a single element in a generic container.

Since: 26.0.0

[h2]HMS_FAST_Sort_CompFunc

typedef int32_t(* HMS_FAST_Sort_CompFunc) (HMS_FAST_SortElementConstPtr first, HMS_FAST_SortElementConstPtr second)

Description

Defines the callback function type for a user-defined comparison function.

Since: 26.0.0

Parameters:

Name Description
first Pointer to the first element.
second Pointer to the second element.

Returns:

Comparison result, which is:

[h2]HMS_FAST_SortData

typedef struct HMS_FAST_SortData HMS_FAST_SortData

Description

Describes a contiguous memory data block to be sorted.

Since: 26.0.0

[h2]HMS_FAST_HannWindowType

typedef enum HMS_FAST_HannWindowType HMS_FAST_HannWindowType

Description

Enumerates the Hanning window types.

Since: 26.0.0

[h2]HMS_FAST_PerfHintConfigBuilder

typedef struct HMS_FAST_PerfHintConfigBuilder HMS_FAST_PerfHintConfigBuilder

Description

Defines the builder for system performance optimization configuration parameters.

Since: 26.0.0

[h2]HMS_FAST_PerfHintConfig

typedef struct HMS_FAST_PerfHintConfig HMS_FAST_PerfHintConfig

Description

Defines the configuration parameters for system performance optimization.

Since: 26.0.0

Constant Description

[h2]FAST_MAX_FFT_LOG2N

const uint32_t FAST_MAX_FFT_LOG2N = 16;

Description

Base-2 logarithm of the maximum number of points supported by the FFT. Specifically, FAST_MAX_FFT_LOG2N=, where N represents the maximum number of points supported by the FFT. For example, an N value of 16 corresponds to a maximum point count of 655,36.

Since: 26.0.0

Enumeration Description

[h2]FAST_ErrorCode

enum FAST_ErrorCode

Description

Enumerates the error codes of FAST Kit.

Since: 6.0.2(22)

Value Description
FAST_ERROR_CODE_SUCCESS = 1023100000 Success.
FAST_ERROR_CODE_FAIL = 1023100001 Failure.
FAST_ERROR_CODE_ILLEGAL_INPUT = 1023100002 Invalid input.
FAST_ERROR_CODE_INVALID_PTR = 1023100003 Invalid pointer (for example, NULL).
FAST_ERROR_CODE_KEY_EXISTS = 1023110000

The key already exists.

Since: 6.1.1(24)

FAST_ERROR_CODE_KEY_NOT_EXISTS = 1023110001

The key does not exist.

Since: 6.1.1(24)

FAST_ERROR_CODE_OOM = 1023199001 Memory overflow.

[h2]FAST_SegmentMapQueryType

enum FAST_SegmentMapQueryType

Description

Enumerates the query types supported by a Segment Map.

This enum defines the range query operations that are supported by the Segment Map data structure.

Since: 6.0.2(22)

Value Description
FAST_SEGMENTMAP_QUERY_TYPE_SUM Range sum query.
FAST_SEGMENTMAP_QUERY_TYPE_MIN Range minimum query.
FAST_SEGMENTMAP_QUERY_TYPE_MAX Range maximum query.

[h2]FAST_SegmentMapUpdateType

enum FAST_SegmentMapUpdateType

Description

Enumerates the update types supported by a Segment Map.

This enum defines the range update operations that are supported by the Segment Map data structure.

Since: 6.0.2(22)

Value Description
FAST_SEGMENTMAP_UPDATE_TYPE_SET Assigns the same value to each element in a given range.
FAST_SEGMENTMAP_UPDATE_TYPE_ADD Adds a same value to each element in a given range.
FAST_SEGMENTMAP_UPDATE_TYPE_SUB Subtracts a same value from each element in a given range.

[h2]HMS_FAST_HannWindowType

enum HMS_FAST_HannWindowType

Description

Enumerates the Hanning window types.

Since: 26.0.0

Value Description
HMS_FAST_HANN_DENORMALIZE_FULL = 0x00 Non-normalized full window.
HMS_FAST_HANN_NORMALIZE_FULL = 0x01 Normalized full window.
HMS_FAST_HANN_DENORMALIZE_HALF = 0x10 Non-normalized half-window. Given a length of N, it contains only the first (N+1)/2 points.
HMS_FAST_HANN_NORMALIZE_HALF = 0x11 Normalized half-window. Given a length of N, it contains only the first (N+1)/2 points.

[h2]HMS_FAST_SchedulingOptimization_SceneType

enum HMS_FAST_SchedulingOptimization_SceneType

Description

Enumerates scenario types requiring system performance optimization.

Since: 26.0.0

Value Description
HMS_FAST_APP_LAUNCH = 1 App launch.
HMS_FAST_PAGE_TRANSITION = 2 Page switching.
HMS_FAST_PAGE_LOAD = 3 Page loading.
HMS_FAST_NETWORK_FILE_PROCESSING = 4 Network file processing.
HMS_FAST_LOCAL_FILE_PROCESSING = 5 Local file processing.
HMS_FAST_PAGE_DRAWING = 6 Page drawing.
HMS_FAST_ANIMATION = 7 Animation.
HMS_FAST_MEDIA_PLAYBACK = 8 Media playback.
HMS_FAST_MEDIA_ENCODING_AND_DECODING = 9 Media encoding and decoding.

[h2]HMS_FAST_SchedulingOptimization_SceneState

enum HMS_FAST_SchedulingOptimization_SceneState

Description

Enumerates scenario states for system performance optimization.

Since: 26.0.0

Value Description
HMS_FAST_END System performance optimization ends.
HMS_FAST_BEGIN System performance optimization starts.

[h2]HMS_FAST_SchedulingOptimization_DurationType

enum HMS_FAST_SchedulingOptimization_DurationType

Description

Enumerates duration options for system performance optimization.

Since: 26.0.0

Value Description
HMS_FAST_SHORT Short duration. The maximum duration for a single optimization operation is 1 second, and the interval between operations must be greater than 3 seconds. Unit: second.
HMS_FAST_MEDIUM Medium duration. The maximum duration for a single optimization operation is 10 seconds, and the interval between operations must be greater than 30 seconds. Unit: second.
HMS_FAST_LONG Long duration. The maximum duration for a single optimization operation is 60 seconds, and the interval between operations must be greater than 180 seconds. Unit: second.

[h2]HMS_FAST_SchedulingOptimization_ErrorCode

enum HMS_FAST_SchedulingOptimization_ErrorCode

Description

Enumerates error codes for system performance optimization.

Since: 26.0.0

Value Description
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS Success.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_HIGH_SYSTEM_LOAD High system load.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_POWER_SAVING_MODE Power saving mode.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_LOW_POWER_MODE Low power mode.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_NON_FRONTEND Non-foreground call scenario.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INTERVAL The interval does not meet the requirements.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_EXECUTE_ERROR Failed to optimize the system performance.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM Invalid parameter.
HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_NO_MEMORY Insufficient memory.

Function Description

[h2]HMS_FAST_RectPartition_CreateConfig()

FAST_EXPORT FAST_ErrorCode HMS_FAST_RectPartition_CreateConfig (FAST_RectPartitionConfig ** config)

Description

Creates the opaque configuration of the Rectangular Partition Solver.

Since: 6.0.2(22)

Parameters:

Name Description
config Pointer to the opaque configuration FAST_RectPartitionConfig of the Rectangular Partition Solver.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_RectPartition_DestroyConfig()

FAST_EXPORT void HMS_FAST_RectPartition_DestroyConfig (FAST_RectPartitionConfig * config)

Description

Destroys the opaque configuration of the Rectangular Partition Solver and deallocates memory. Accessing this opaque configuration again after destruction is considered undefined behavior.

Since: 6.0.2(22)

Parameters:

Name Description
config To-be-destroyed opaque configuration FAST_RectPartitionConfig of the Rectangular Partition Solver.

[h2]HMS_FAST_RectPartition_SetAlgo()

FAST_EXPORT FAST_ErrorCode HMS_FAST_RectPartition_SetAlgo (FAST_RectPartitionConfig * config, const char * name )

Description

Sets the algorithm used by the Rectangular Partition Solver. Currently, only the SweepLineAlgo algorithm is supported, which outputs a set of non-overlapping rectangles with a minimized count (not guaranteed to be optimal), operating at O(N logN) complexity.

Since: 6.0.2(22)

Parameters:

Name Description
config To-be-set opaque configuration FAST_RectPartitionConfig of the Rectangular Partition Solver.
name Name of the algorithm used by the Rectangular Partition Solver. Currently, only the SweepLineAlgo scanline algorithm is supported. It outputs a set of non-overlapping rectangles with as few rectangles as possible (without guaranteeing optimality). The time complexity is .

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config or name is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the algorithm is not supported, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_RectPartition_Solve()

FAST_EXPORT FAST_ErrorCode HMS_FAST_RectPartition_Solve (FAST_RectPartitionConfig * config, size_t size, const FAST_Rect * origin, FAST_Rect * result, size_t * resultSize )

Description

Solves the rectangular partition problem under the specified opaque configuration. The result array must be initialized before this function is called.

Since: 6.0.2(22)

Parameters:

Name Description
config Opaque configuration of the Rectangular Partition Solver. If no algorithm is set in the configuration, the default algorithm SweepLineAlgo is used.
size Number of rectangles (FAST_Rect) to be partitioned.
origin Rectangle (FAST_Rect) source array to be partitioned.
result Array to store output rectangles (FAST_Rect) after partitioning. The result array must be initialized before this function is called. The size of the result array must be the same as that of the source array. Otherwise, a memory overflow may occur.
resultSize Number of rectangles (FAST_Rect) after partitioning.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If the input parameter pointer is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the input is invalid (for example, overlapping rectangles), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If the algorithm fails to solve the problem, FAST_ERROR_CODE_FAIL is returned.

NOTE

If the SweepLineAlgo algorithm is selected For config, FAST_ERROR_CODE_FAIL will not be returned. This is only a preventive measure.

[h2]HMS_FAST_PolyRoot_ComputeRoots()

FAST_ErrorCode HMS_FAST_PolyRoot_ComputeRoots (const FAST_Poly * poly, const size_t maxRootCount, double * root, size_t * rootCount )

Description

Computes a specified number of real roots of the polynomial.

Since: 26.0.0

Parameters:

Name Description
poly Polynomial FAST_Poly whose roots are to be computed.
maxRootCount Number of real roots that need to be returned.
root Array of output real roots.
rootCount Number of real roots actually returned.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If poly, root, or rootCount is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the input is invalid (for example, the exponents are not sorted in ascending order), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_PolyRoot_ComputeSingle()

FAST_ErrorCode HMS_FAST_PolyRoot_ComputeSingle (const FAST_Poly * poly, double * root )

Description

Computes the real root of the polynomial with the largest absolute value.

Since: 26.0.0

Parameters:

Name Description
poly Polynomial FAST_Poly whose roots are to be computed.
root Computed real root.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If poly or root is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the input is invalid (for example, the exponents are not sorted in ascending order), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_PolyRoot_ComputeRootIntervals()

FAST_ErrorCode HMS_FAST_PolyRoot_ComputeRootIntervals (const FAST_Poly * poly, const size_t maxRootCount, double * leftBoundary, double * rightBoundary, size_t * rootCount )

Description

Computes the isolation intervals for a specified number of real roots of a polynomial, outputting the left and right bounds of each real root. Each interval contains only one real root.

Since: 26.0.0

Parameters:

Name Description
poly Polynomial FAST_Poly for which isolation intervals are to be computed.
maxRootCount Number of intervals for the real roots to be output.
leftBoundary Array of the left bounds of each real root interval.
rightBoundary Array of the right bounds of each real root interval.
rootCount Number of real roots actually found and returned.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If poly, leftBoundary, rightBoundary or rootCount is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the input is invalid (for example, the exponents are not sorted in ascending order), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_SegmentMap_Create()

FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_Create (FAST_SegmentMapHandle * handle, size_t size, const int32_t * array, FAST_SegmentMapConfig * config )

Description

Creates a Segment Map.

Since: 6.0.2(22)

Parameters:

Name Description
handle Pointer to the Segment Map handle FAST_SegmentMapHandle.
size Size (number of elements) of the underlying array.
array Underlying array for initializing a Segment Map. This parameter is optional. If the value is NULL, all elements in the Segment Map are initialized to 0. Otherwise, the array size must be the same as that specified by the size parameter.
config Opaque configuration of the Segment Map (FAST_SegmentMapConfig). If this parameter is set to NULL or not configured, the default query type is FAST_SEGMENTMAP_QUERY_TYPE_SUM and the default update type is FAST_SEGMENTMAP_UPDATE_TYPE_SET.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config or handle is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_SegmentMap_CreateConfig()

FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_CreateConfig (FAST_SegmentMapConfig ** config)

Description

Creates the opaque configuration of a Segment Map.

Since: 6.0.2(22)

Parameters:

Name Description
config Pointer to the opaque configuration of a Segment Map (FAST_SegmentMapConfig).

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_SegmentMap_Destroy()

FAST_EXPORT void HMS_FAST_SegmentMap_Destroy (FAST_SegmentMapHandle handle)

Description

Destroys a Segment Map instance.

Since: 6.0.2(22)

Parameters:

Name Description
handle Handle to the Segment Map (FAST_SegmentMapHandle) to be destroyed.

[h2]HMS_FAST_SegmentMap_DestroyConfig()

FAST_EXPORT void HMS_FAST_SegmentMap_DestroyConfig (FAST_SegmentMapConfig * config)

Description

Destroys the opaque configuration of a Segment Map.

Since: 6.0.2(22)

Parameters:

Name Description
config To-be-destroyed opaque configuration of a Segment Map (FAST_SegmentMapConfig).

[h2]HMS_FAST_SegmentMap_Query()

FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_Query (FAST_SegmentMapHandle handle, size_t left, size_t right, int32_t * result )

Description

Performs a range query on a Segment Map.

Since: 6.0.2(22)

Parameters:

Name Description
handle Handle to a Segment Map.
left Left endpoint (included) of a range. The range is left-closed and right-open.
right Right endpoint (excluded) of a range. The range is left-closed and right-open.
result Range query result.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the input is invalid (for example, the left endpoint is greater than or equal to the right endpoint), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_SegmentMap_SetQueryType()

FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_SetQueryType (FAST_SegmentMapConfig * config, FAST_SegmentMapQueryType type )

Description

Sets the query type in the opaque configuration of a Segment Map.

Since: 6.0.2(22)

Parameters:

Name Description
config To-be-modified opaque configuration of a Segment Map.
type Query type.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

[h2]HMS_FAST_SegmentMap_SetUpdateType()

FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_SetUpdateType (FAST_SegmentMapConfig * config, FAST_SegmentMapUpdateType type )

Description

Sets the update type in the opaque configuration of a Segment Map.

Since: 6.0.2(22)

Parameters:

Name Description
config To-be-modified opaque configuration of a Segment Map.
type Update type.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

[h2]HMS_FAST_SegmentMap_Update()

FAST_EXPORT FAST_ErrorCode HMS_FAST_SegmentMap_Update (FAST_SegmentMapHandle handle, size_t left, size_t right, int32_t value )

Description

Performs a range update on a Segment Map.

Since: 6.0.2(22)

Parameters:

Name Description
handle Handle to a Segment Map.
left Left endpoint (included) of a range. The range is left-closed and right-open.
right Right endpoint (excluded) of a range. The range is left-closed and right-open.
value New value.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the input is invalid (for example, the left endpoint is greater than or equal to the right endpoint), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_Biquadm_Create()

FAST_ErrorCode HMS_FAST_Biquadm_Create (size_t numChannels, size_t numSections, size_t maxFrames, FAST_Biquadm ** filter)

Description

Creates and initializes a multi-channel, multi-section biquad IIR filter bank (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
numChannels Number of signal channels. The value must be greater than 0.
numSections Number of cascaded biquad sections per channel. The value must be greater than 0.
maxFrames Maximum number of samples processed at a time (per channel). The value must be greater than 0.
filter Pointer to the variable that receives the address of the newly created filter.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If numChannels, numSections, or maxFrames is 0, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If the memory is exhausted and the allocation fails, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_Biquadm_CreateD()

FAST_ErrorCode HMS_FAST_Biquadm_CreateD (size_t numChannels, size_t numSections, size_t maxFrames, FAST_BiquadmD ** filter)

Description

Creates and initializes a multi-channel, multi-section biquad IIR filter bank (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
numChannels Number of signal channels. The value must be greater than 0.
numSections Number of cascaded biquad sections per channel. The value must be greater than 0.
maxFrames Maximum number of samples processed at a time (per channel). The value must be greater than 0.
filter Pointer to the variable that receives the address of the newly created filter.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If numChannels, numSections, or maxFrames is 0, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If the memory is exhausted and the allocation fails, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_Biquadm_Destroy()

void HMS_FAST_Biquadm_Destroy (FAST_Biquadm * filter)

Description

Destroys a biquad filter instance (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
filter Biquad filter instance to be destroyed.

[h2]HMS_FAST_Biquadm_DestroyD()

void HMS_FAST_Biquadm_DestroyD (FAST_BiquadmD * filter)

Description

Destroys a biquad filter instance (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
filter Biquad filter instance to be destroyed.

[h2]HMS_FAST_Biquadm_SetCoeffSingle()

FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffSingle (FAST_Biquadm * filter, const float * coeff, size_t stride)

Description

Sets all biquad filter coefficients from a single-precision source array (single-precision filter). The coefficients are ordered as [b0, b1, b2, a1, a2] for each (channel, section) pair, formatted in channel-major layout where the record index is defined as: channel × section count + section.

Since: 6.1.1(24)

Parameters:

Name Description
filter Pointer to an initialized biquad filter group.
coeff Source coefficient array.
stride Stride between stages in the source array (measured in stages). The value 1 indicates contiguous storage.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter or coeff is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_Biquadm_SetCoeffDouble()

FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffDouble (FAST_Biquadm * filter, const double * coeff, size_t stride)

Description

Sets all biquad filter coefficients from a double-precision source array (single-precision filter). The coefficients are ordered as [b0, b1, b2, a1, a2] for each (channel, section) pair, formatted in channel-major layout where the record index is defined as: channel × section count + section.

Since: 6.1.1(24)

Parameters:

Name Description
filter Pointer to an initialized biquad filter group.
coeff Source coefficient array.
stride Stride between stages in the source array (measured in stages). The value 1 indicates contiguous storage.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter or coeff is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_Biquadm_SetCoeffSingleD()

FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffSingleD (FAST_BiquadmD * filter, const float * coeff, size_t stride)

Description

Sets all biquad filter coefficients from a single-precision source array (double-precision filter). The coefficients are ordered as [b0, b1, b2, a1, a2] for each (channel, section) pair, formatted in channel-major layout where the record index is defined as: channel × section count + section.

Since: 6.1.1(24)

Parameters:

Name Description
filter Pointer to an initialized biquad filter group.
coeff Source coefficient array.
stride Stride between stages in the source array (measured in stages). The value 1 indicates contiguous storage.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter or coeff is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_Biquadm_SetCoeffDoubleD()

FAST_ErrorCode HMS_FAST_Biquadm_SetCoeffDoubleD (FAST_BiquadmD * filter, const double * coeff, size_t stride)

Description

Sets all biquad filter coefficients from a double-precision source array (double-precision filter). The coefficients are ordered as [b0, b1, b2, a1, a2] for each (channel, section) pair, formatted in channel-major layout where the record index is defined as: channel × section count + section.

Since: 6.1.1(24)

Parameters:

Name Description
filter Pointer to an initialized biquad filter group.
coeff Source coefficient array.
stride Stride between stages in the source array (measured in stages). The value 1 indicates contiguous storage.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter or coeff is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_Biquadm_SetActiveFilters()

FAST_ErrorCode HMS_FAST_Biquadm_SetActiveFilters (FAST_Biquadm * filter, const uint8_t * activeMask)

Description

Sets the activation mask for biquad filter sections (single-precision). The mask sequence is [sec0, sec1, ...].

Since: 6.1.1(24)

Parameters:

Name Description
filter Pointer to an initialized biquad filter group.
activeMask Boolean array (size: filter->numSections). A non-zero value indicates activation.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter or activeMask is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized or activeFilters of filter is NULL, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_Biquadm_SetActiveFiltersD()

FAST_ErrorCode HMS_FAST_Biquadm_SetActiveFiltersD (FAST_BiquadmD * filter, const uint8_t * activeMask)

Description

Sets the activation mask for biquad filter sections (double-precision). The mask sequence is [sec0, sec1, ...].

Since: 6.1.1(24)

Parameters:

Name Description
filter Pointer to an initialized biquad filter group.
activeMask Boolean array (size: filter->numSections). A non-zero value indicates activation.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter or activeMask is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized or activeFilters of filter is NULL, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_Biquadm()

FAST_ErrorCode HMS_FAST_Biquadm (FAST_Biquadm * filter, const float ** input, const size_t strideInput, float ** output, const size_t strideOutput, size_t length)

Description

Processes multi-channel audio through a biquad filter bank (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
filter Initialized filter bank.
input Pointer array of input channels (size: filter->numChannels).
strideInput Stride within each input channel. The value 1 indicates contiguous storage.
output Pointer array of output channels (size: filter->numChannels).
strideOutput Stride within each output channel. The value 1 indicates contiguous storage.
length Number of frames to be processed (which must be less than or equal to filter->maxFrames).

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter, input, or output is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized or length is out of range, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_BiquadmD()

FAST_ErrorCode HMS_FAST_BiquadmD (FAST_BiquadmD * filter, const double ** input, const size_t strideInput, double ** output, const size_t strideOutput, size_t length)

Description

Processes multi-channel audio through a biquad filter bank (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
filter Initialized filter bank.
input Pointer array of input channels (size: filter->numChannels).
strideInput Stride within each input channel. The value 1 indicates contiguous storage.
output Pointer array of output channels (size: filter->numChannels).
strideOutput Stride within each output channel. The value 1 indicates contiguous storage.
length Number of frames to be processed (which must be less than or equal to filter->maxFrames).

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If filter, input, or output is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If filter is not initialized or length is out of range, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_DSP_Maxmgv()

float HMS_FAST_DSP_Maxmgv (const float * input, size_t stride, size_t length)

Description

Computes the maximum magnitude of a strided real vector (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples to be processed.

Returns:

Maximum absolute value in the vector. If length is 0, 0.0f is returned.

[h2]HMS_FAST_DSP_MaxmgvD()

double HMS_FAST_DSP_MaxmgvD (const double * input, size_t stride, size_t length)

Description

Computes the maximum magnitude of a strided real vector (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples to be processed.

Returns:

Maximum absolute value in the vector. If length is 0, 0.0 is returned.

[h2]HMS_FAST_DSP_Maxvi()

void HMS_FAST_DSP_Maxvi (const float * input, size_t stride, size_t length, float * value, size_t * index)

Description

Finds the maximum value and its index in a strided real vector (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.
value Pointer to where the maximum value is stored. If length is 0, -FLT_MAX is returned.
index Index of the sample with the maximum value (starting from 0). If length is 0, 0 is returned.

Returns:

None

[h2]HMS_FAST_DSP_MaxviD()

void HMS_FAST_DSP_MaxviD (const double * input, size_t stride, size_t length, double * value, size_t * index)

Description

Finds the maximum value and its index in a strided real vector (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.
value Pointer to where the maximum value is stored. If length is 0, -DBL_MAX is returned.
index Index of the sample with the maximum value (starting from 0). If length is 0, 0 is returned.

Returns:

None

[h2]HMS_FAST_DSP_Sve()

float HMS_FAST_DSP_Sve (const float * input, size_t stride, size_t length)

Description

Computes the sum of a strided real vector (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Sum of input[i] for all valid indices i. If length is 0, 0.0f is returned.

[h2]HMS_FAST_DSP_SveD()

double HMS_FAST_DSP_SveD (const double * input, size_t stride, size_t length)

Description

Computes the sum of a strided real vector (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Sum of input[i] for all valid indices i. If length is 0, 0.0 is returned.

[h2]HMS_FAST_DSP_Svemg()

float HMS_FAST_DSP_Svemg (const float * input, size_t stride, size_t length)

Description

Computes the sum of absolute values (L1 norm) of a strided vector (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Sum of the absolute values of all elements in the input vector. If length is 0, 0.0f is returned.

[h2]HMS_FAST_DSP_SvemgD()

double HMS_FAST_DSP_SvemgD (const double * input, size_t stride, size_t length)

Description

Computes the sum of absolute values (L1 norm) of a strided vector (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Sum of the absolute values of all elements in the input vector. If length is 0, 0.0 is returned.

[h2]HMS_FAST_DSP_Meamgv()

float HMS_FAST_DSP_Meamgv (const float * input, size_t stride, size_t length)

Description

Computes the mean of absolute values of a strided real vector (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Mean value of |input[i]| for all valid indices i. If length is 0, 0.0f is returned.

[h2]HMS_FAST_DSP_MeamgvD()

double HMS_FAST_DSP_MeamgvD (const double * input, size_t stride, size_t length)

Description

Computes the mean of absolute values of a strided real vector (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Mean value of |input[i]| for all valid indices i. If length is 0, 0.0 is returned.

[h2]HMS_FAST_DSP_Dotpr()

float HMS_FAST_DSP_Dotpr (const float * inputA, size_t strideA, const float * inputB, size_t strideB, size_t length)

Description

Computes the dot product of two strided real vectors (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
inputA First input tensor.
strideA Stride of the first vector. The value 1 indicates contiguous storage.
inputB Second input tensor.
strideB Stride of the second vector. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Dot product: sum(inputA[i] * inputB[i]) for all valid indices i. If length is 0, 0.0f is returned.

[h2]HMS_FAST_DSP_DotprD()

double HMS_FAST_DSP_DotprD (const double * inputA, size_t strideA, const double * inputB, size_t strideB, size_t length)

Description

Computes the dot product of two strided real vectors (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
inputA First input tensor.
strideA Stride of the first vector. The value 1 indicates contiguous storage.
inputB Second input tensor.
strideB Stride of the second vector. The value 1 indicates contiguous storage.
length Number of samples.

Returns:

Dot product: sum(inputA[i] * inputB[i]) for all valid indices i. If length is 0, 0.0 is returned.

[h2]HMS_FAST_DSP_Vsbsm()

void HMS_FAST_DSP_Vsbsm (const float * inputA, size_t strideA, const float * inputB, size_t strideB, float scalar, float * outputC, size_t strideC, size_t length)

Description

Performs vector subtraction: outputC[i] = (inputA[i] - inputB[i]) * scalar (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
inputA First input tensor.
strideA Stride of the first vector. The value 1 indicates contiguous storage.
inputB Second input tensor.
strideB Stride of the second vector. The value 1 indicates contiguous storage.
scalar Scalar used for the computation.
outputC Output vector (allocated by the caller).
strideC Stride of the output vector. The value 1 indicates contiguous storage.
length Number of samples. The value must be greater than 0.

Returns:

None

[h2]HMS_FAST_DSP_VsbsmD()

void HMS_FAST_DSP_VsbsmD (const double * inputA, size_t strideA, const double * inputB, size_t strideB, double scalar, double * outputC, size_t strideC, size_t length)

Description

Performs vector subtraction: outputC[i] = (inputA[i] - inputB[i]) * scalar (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
inputA First input tensor.
strideA Stride of the first vector. The value 1 indicates contiguous storage.
inputB Second input tensor.
strideB Stride of the second vector. The value 1 indicates contiguous storage.
scalar Scalar used for the computation.
outputC Output vector (allocated by the caller).
strideC Stride of the output vector. The value 1 indicates contiguous storage.
length Number of samples. The value must be greater than 0.

Returns:

None

[h2]HMS_FAST_DSP_Ctoz()

void HMS_FAST_DSP_Ctoz (const float * input, size_t strideInput, FAST_SplitComplex * output, size_t strideOutput, size_t length)

Description

Converts an interleaved complex array (real, imag, real, imag, ...) to the split format (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Interleaved complex input (length is twice the number of complex numbers).
strideInput Stride between complex samples. The value 1 indicates contiguous storage.
output Split complex output struct.
strideOutput Stride between real/imaginary samples in the output array. The value 1 indicates contiguous storage.
length Number of complex samples to convert. The value must be greater than 0.

Returns:

None

[h2]HMS_FAST_DSP_CtozD()

void HMS_FAST_DSP_CtozD (const double * input, size_t strideInput, FAST_SplitComplexD * output, size_t strideOutput, size_t length)

Description

Converts an interleaved complex array (real, imag, real, imag, ...) to the split format (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Interleaved complex input (length is twice the number of complex numbers).
strideInput Stride between complex samples. The value 1 indicates contiguous storage.
output Split complex output struct.
strideOutput Stride between real/imaginary samples in the output array. The value 1 indicates contiguous storage.
length Number of complex samples to convert. The value must be greater than 0.

Returns:

None

[h2]HMS_FAST_DSP_Ztoc()

void HMS_FAST_DSP_Ztoc (const FAST_SplitComplex * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Converts a split complex array to the interleaved format (single-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Split complex input struct.
strideInput Stride between samples in the real/imaginary array. The value 1 indicates contiguous storage.
output Interleaved output array (length is twice the number of complex numbers)
strideOutput Stride between complex samples in the output. The value 1 indicates contiguous storage.
length Number of complex samples to convert. The value must be greater than 0.

Returns:

None

[h2]HMS_FAST_DSP_ZtocD()

void HMS_FAST_DSP_ZtocD (const FAST_SplitComplexD * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Converts a split complex array to the interleaved format (double-precision).

Since: 6.1.1(24)

Parameters:

Name Description
input Split complex input struct.
strideInput Stride between samples in the real/imaginary array. The value 1 indicates contiguous storage.
output Interleaved output array (length is twice the number of complex numbers)
strideOutput Stride between complex samples in the output. The value 1 indicates contiguous storage.
length Number of complex samples to convert. The value must be greater than 0.

Returns:

None

[h2]HMS_FAST_DSP_Zvabs()

void HMS_FAST_DSP_Zvabs (const FAST_SplitComplex * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Computes the magnitude of a complex vector (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input complex vector in split format.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector (magnitude).
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of complex elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_ZvabsD()

void HMS_FAST_DSP_ZvabsD (const FAST_SplitComplexD * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Computes the magnitude of a complex vector (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input complex vector in split format.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector (magnitude).
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of complex elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Zvmags()

void HMS_FAST_DSP_Zvmags (const FAST_SplitComplex * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Computes the squared magnitude of a complex vector (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input complex vector in split format.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector (squared magnitude).
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of complex elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_ZvmagsD()

void HMS_FAST_DSP_ZvmagsD (const FAST_SplitComplexD * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Computes the squared magnitude of a complex vector (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input complex vector in split format.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector (squared magnitude).
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of complex elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Zvphas()

void HMS_FAST_DSP_Zvphas (const FAST_SplitComplex * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Computes the phase angles (in radians) of a complex vector (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input complex vector in split format.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector (phase angle).
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of complex elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_ZvphasD()

void HMS_FAST_DSP_ZvphasD (const FAST_SplitComplexD * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Computes the phase angles (in radians) of a complex vector (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input complex vector in split format.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector (phase angle).
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of complex elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vsmul()

void HMS_FAST_DSP_Vsmul (const float * input, size_t strideInput, const float scalar, float * output, size_t strideOutput, size_t length)

Description

Multiplies each element of a vector by a scalar: output[i] = input[i] * scalar (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
scalar Scalar for multiplication.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VsmulD()

void HMS_FAST_DSP_VsmulD (const double * input, size_t strideInput, const double scalar, double * output, size_t strideOutput, size_t length)

Description

Multiplies each element of a vector by a scalar: output[i] = input[i] * scalar (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
scalar Scalar for multiplication.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vsdiv()

void HMS_FAST_DSP_Vsdiv (const float * input, size_t strideInput, const float scalar, float * output, size_t strideOutput, size_t length)

Description

Divides each element of a vector by a scalar: output[i] = input[i] / scalar (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
scalar Divisor scalar.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VsdivD()

void HMS_FAST_DSP_VsdivD (const double * input, size_t strideInput, const double scalar, double * output, size_t strideOutput, size_t length)

Description

Divides each element of a vector by a scalar: output[i] = input[i] / scalar (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
scalar Divisor scalar.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Svdiv()

void HMS_FAST_DSP_Svdiv (const float scalar, const float * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Divides a scalar by each element of a vector: output[i] = scalar / input[i] (single-precision).

Since: 26.0.0

Parameters:

Name Description
scalar Dividend scalar.
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_SvdivD()

void HMS_FAST_DSP_SvdivD (const double scalar, const double * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Divides a scalar by each element of a vector: output[i] = scalar / input[i] (double-precision).

Since: 26.0.0

Parameters:

Name Description
scalar Dividend scalar.
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vsadd()

void HMS_FAST_DSP_Vsadd (const float * input, size_t strideInput, const float scalar, float * output, size_t strideOutput, size_t length)

Description

Adds a scalar to each element of a vector: output[i] = input[i] + scalar (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
scalar Scalar for addition.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VsaddD()

void HMS_FAST_DSP_VsaddD (const double * input, size_t strideInput, const double scalar, double * output, size_t strideOutput, size_t length)

Description

Adds a scalar to each element of a vector: output[i] = input[i] + scalar (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
scalar Scalar for addition.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vadd()

void HMS_FAST_DSP_Vadd (const float * inputA, size_t strideA, const float * inputB, size_t strideB, float * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector addition: C[i] = A[i] + B[i] (single-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VaddD()

void HMS_FAST_DSP_VaddD (const double * inputA, size_t strideA, const double * inputB, size_t strideB, double * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector addition: C[i] = A[i] + B[i] (double-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vsub()

void HMS_FAST_DSP_Vsub (const float * inputA, size_t strideA, const float * inputB, size_t strideB, float * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector subtraction: C[i] = A[i] - B[i] (single-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VsubD()

void HMS_FAST_DSP_VsubD (const double * inputA, size_t strideA, const double * inputB, size_t strideB, double * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector subtraction: C[i] = A[i] - B[i] (double-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vmul()

void HMS_FAST_DSP_Vmul (const float * inputA, size_t strideA, const float * inputB, size_t strideB, float * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector multiplication: C[i] = A[i] * B[i] (single-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VmulD()

void HMS_FAST_DSP_VmulD (const double * inputA, size_t strideA, const double * inputB, size_t strideB, double * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector multiplication: C[i] = A[i] * B[i] (double-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vdiv()

void HMS_FAST_DSP_Vdiv (const float * inputA, size_t strideA, const float * inputB, size_t strideB, float * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector division: C[i] = A[i] / B[i] (single-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to input vector A (dividend).
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to input vector B (divisor).
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VdivD()

void HMS_FAST_DSP_VdivD (const double * inputA, size_t strideA, const double * inputB, size_t strideB, double * outputC, size_t strideC, size_t length)

Description

Performs element-wise vector division: C[i] = A[i] / B[i] (double-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to input vector A (dividend).
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to input vector B (divisor).
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vdist()

void HMS_FAST_DSP_Vdist (const float * inputA, size_t strideA, const float * inputB, size_t strideB, float * outputC, size_t strideC, size_t length)

Description

Computes the element-wise Euclidean norm of two vectors (single-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VdistD()

void HMS_FAST_DSP_VdistD (const double * inputA, size_t strideA, const double * inputB, size_t strideB, double * outputC, size_t strideC, size_t length)

Description

Computes the element-wise Euclidean norm of two vectors (double-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the input vector A.
strideA Stride of vector A. The value 1 indicates contiguous storage.
inputB Pointer to the input vector B.
strideB Stride of vector B. The value 1 indicates contiguous storage.
outputC Pointer to the output vector C.
strideC Stride of vector C. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Svesq()

float HMS_FAST_DSP_Svesq (const float * input, size_t stride, size_t length)

Description

Computes the sum of squares of vector elements (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
stride Stride of the input vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

Sum of squares of vector elements.

[h2]HMS_FAST_DSP_SvesqD()

double HMS_FAST_DSP_SvesqD (const double * input, size_t stride, size_t length)

Description

Computes the sum of squares of vector elements (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
stride Stride of the input vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

Sum of squares of vector elements.

[h2]HMS_FAST_DSP_Minvi()

void HMS_FAST_DSP_Minvi (const float * input, size_t stride, size_t length, float * value, size_t * index)

Description

Finds the minimum value and its index in a strided real vector (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples to be processed.
value Output parameter, which stores the found minimum value. If length is 0, set this parameter to FLT_MAX.
index Output parameter, which stores the index (0-based) of the minimum value. If length is 0, set this parameter to 0.

Returns:

None

[h2]HMS_FAST_DSP_MinviD()

void HMS_FAST_DSP_MinviD (const double * input, size_t stride, size_t length, double * value, size_t * index)

Description

Finds the minimum value and its index in a strided real vector (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
stride Stride between consecutive samples. The value 1 indicates contiguous storage.
length Number of samples to be processed.
value Output parameter, which stores the found minimum value. If length is 0, set this parameter to DBL_MAX.
index Output parameter, which stores the index (0-based) of the minimum value. If length is 0, set this parameter to 0.

Returns:

None

[h2]HMS_FAST_DSP_Vsq()

void HMS_FAST_DSP_Vsq (const float * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Computes the square of each vector element (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VsqD()

void HMS_FAST_DSP_VsqD (const double * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Computes the square of each vector element (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vabs()

void HMS_FAST_DSP_Vabs (const float * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Computes the absolute value of each vector element (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VabsD()

void HMS_FAST_DSP_VabsD (const double * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Computes the absolute value of each vector element (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vthr()

void HMS_FAST_DSP_Vthr (const float * input, size_t strideInput, const float threshold, float * output, size_t strideOutput, size_t length)

Description

Applies a threshold to a vector. If input[i] < threshold, then output[i] = threshold; otherwise, output[i] = input[i] (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
threshold Threshold scalar.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VthrD()

void HMS_FAST_DSP_VthrD (const double * input, size_t strideInput, const double threshold, double * output, size_t strideOutput, size_t length)

Description

Applies a threshold to a vector. If input[i] < threshold, then output[i] = threshold; otherwise, output[i] = input[i] (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
threshold Threshold scalar.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vrvrs()

void HMS_FAST_DSP_Vrvrs (float * vector, size_t stride, size_t length)

Description

Reverses the order of vector elements in place (single-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the vector to be reversed.
stride Stride of the vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VrvrsD()

void HMS_FAST_DSP_VrvrsD (double * vector, size_t stride, size_t length)

Description

Reverses the order of vector elements in place (double-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the vector to be reversed.
stride Stride of the vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vspdp()

void HMS_FAST_DSP_Vspdp (const float * input, size_t strideInput, double * output, size_t strideOutput, size_t length)

Description

Converts a single-precision vector to a double-precision vector.

Since: 26.0.0

Parameters:

Name Description
input Pointer to the single-precision input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the double-precision output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vdpsp()

void HMS_FAST_DSP_Vdpsp (const double * input, size_t strideInput, float * output, size_t strideOutput, size_t length)

Description

Converts a double-precision vector to a single-precision vector.

Since: 26.0.0

Parameters:

Name Description
input Pointer to the double-precision input vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
output Pointer to the single-precision output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vfill()

void HMS_FAST_DSP_Vfill (float * vector, size_t stride, size_t length, const float scalar)

Description

Fills a vector with a specified scalar value (single-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the vector to be filled.
stride Stride of the vector. The value 1 indicates contiguous storage.
length Number of elements to be filled.
scalar Scalar value.

Returns:

None

[h2]HMS_FAST_DSP_VfillD()

void HMS_FAST_DSP_VfillD (double * vector, size_t stride, size_t length, const double scalar)

Description

Fills a vector with a specified scalar value (double-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the vector to be filled.
stride Stride of the vector. The value 1 indicates contiguous storage.
length Number of elements to be filled.
scalar Scalar value.

Returns:

None

[h2]HMS_FAST_DSP_Vclr()

void HMS_FAST_DSP_Vclr (float * vector, size_t stride, size_t length)

Description

Clears all elements in a vector (single-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the output vector.
stride Stride of the vector. The value 1 indicates contiguous storage.
length Number of elements to be cleared.

Returns:

None

[h2]HMS_FAST_DSP_VclrD()

void HMS_FAST_DSP_VclrD (double * vector, size_t stride, size_t length)

Description

Clears all elements in a vector (double-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the output vector.
stride Stride of the vector. The value 1 indicates contiguous storage.
length Number of elements to be cleared.

Returns:

None

[h2]HMS_FAST_DSP_Conv()

void HMS_FAST_DSP_Conv (const float * input, size_t strideInput, const float * filter, size_t strideFilter, float * output, size_t strideOutput, size_t outputLength, size_t filterLength)

Description

Performs convolution on two vectors (single-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input signal vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
filter Pointer to the filter coefficient vector.
strideFilter Stride of the filter vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
outputLength Number of elements in the output vector.
filterLength Number of elements in the filter vector.

Returns:

None

NOTE

The length of the input buffer must be greater than outputLength + filterLength - 1. Otherwise, undefined behavior occurs.

[h2]HMS_FAST_DSP_ConvD()

void HMS_FAST_DSP_ConvD (const double * input, size_t strideInput, const double * filter, size_t strideFilter, double * output, size_t strideOutput, size_t outputLength, size_t filterLength)

Description

Performs convolution on two vectors (double-precision).

Since: 26.0.0

Parameters:

Name Description
input Pointer to the input signal vector.
strideInput Stride of the input vector. The value 1 indicates contiguous storage.
filter Pointer to the filter coefficient vector.
strideFilter Stride of the filter vector. The value 1 indicates contiguous storage.
output Pointer to the output vector.
strideOutput Stride of the output vector. The value 1 indicates contiguous storage.
outputLength Number of elements in the output vector.
filterLength Number of elements in the filter vector.

Returns:

None

NOTE

The length of the input buffer must be greater than outputLength + filterLength - 1. Otherwise, undefined behavior occurs.

[h2]HMS_FAST_DSP_HannWindow()

void HMS_FAST_DSP_HannWindow (float * output, size_t length, HMS_FAST_HannWindowType type)

Description

Generates a Hanning window sequence (single-precision).

Since: 26.0.0

Parameters:

Name Description
output Pointer to the output vector, which is used to store the window coefficients.
length Number of generated window points.
type Window type. For details, see HMS_FAST_HannWindowType.

Returns:

None

[h2]HMS_FAST_DSP_HannWindowD()

void HMS_FAST_DSP_HannWindowD (double * output, size_t length, HMS_FAST_HannWindowType type)

Description

Generates a Hanning window sequence (double-precision).

Since: 26.0.0

Parameters:

Name Description
output Pointer to the output vector, which is used to store the window coefficients.
length Number of generated window points.
type Window type. For details, see HMS_FAST_HannWindowType.

Returns:

None

[h2]HMS_FAST_DSP_Mmul()

void HMS_FAST_DSP_Mmul (const float * matrixA, size_t strideA, const float * matrixB, size_t strideB, float * matrixC, size_t strideC, size_t rowsM, size_t colsN, size_t colsP)

Description

Performs matrix multiplication: C = A * B, where A is an M × P matrix, B is a P × N matrix, and C is an M × N matrix (single-precision).

Since: 26.0.0

Parameters:

Name Description
matrixA Pointer to matrix A.
strideA Element stride of matrix A.
matrixB Pointer to matrix B.
strideB Element stride of matrix B.
matrixC Pointer to matrix C (result).
strideC Element stride of matrix C.
rowsM Number of rows in matrices A and C.
colsN Number of columns in matrices B and C.
colsP Number of columns in matrix A and number of rows in matrix B.

Returns:

None

[h2]HMS_FAST_DSP_MmulD()

void HMS_FAST_DSP_MmulD (const double * matrixA, size_t strideA, const double * matrixB, size_t strideB, double * matrixC, size_t strideC, size_t rowsM, size_t colsN, size_t colsP)

Description

Performs matrix multiplication: C = A * B, where A is an M × P matrix, B is a P × N matrix, and C is an M × N matrix (double-precision).

Since: 26.0.0

Parameters:

Name Description
matrixA Pointer to matrix A.
strideA Element stride of matrix A.
matrixB Pointer to matrix B.
strideB Element stride of matrix B.
matrixC Pointer to matrix C (result).
strideC Element stride of matrix C.
rowsM Number of rows in matrices A and C.
colsN Number of columns in matrices B and C.
colsP Number of columns in matrix A and number of rows in matrix B.

Returns:

None

[h2]HMS_FAST_DSP_Vvpow()

void HMS_FAST_DSP_Vvpow (const float * inputA, const float * inputB, float * outputC, size_t length)

Description

Performs element-wise vector power operation: C[i] = A[i] raised to the power of B[i] (single-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the based vector A.
inputB Pointer to the exponent vector B
outputC Pointer to the output vector C.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_VvpowD()

void HMS_FAST_DSP_VvpowD (const double * inputA, const double * inputB, double * outputC, size_t length)

Description

Performs element-wise vector power operation: C[i] = A[i] raised to the power of B[i] (double-precision).

Since: 26.0.0

Parameters:

Name Description
inputA Pointer to the based vector A.
inputB Pointer to the exponent vector B
outputC Pointer to the output vector C.
length Number of elements to be processed.

Returns:

None

[h2]HMS_FAST_DSP_Vsort()

void HMS_FAST_DSP_Vsort (float * vector, size_t length, int order)

Description

Sorts vectors in place (single-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the vector to be sorted (input/output).
length Number of elements to be sorted.
order Sort order (1: ascending; -1: descending; other values: no operation).

Returns:

None

[h2]HMS_FAST_DSP_VsortD()

void HMS_FAST_DSP_VsortD (double * vector, size_t length, int order)

Description

Sorts vectors in place (double-precision).

Since: 26.0.0

Parameters:

Name Description
vector Pointer to the vector to be sorted (input/output).
length Number of elements to be sorted.
order Sort order (1: ascending; -1: descending; other values: no operation).

Returns:

None

[h2]HMS_FAST_FFT_CreateConfig()

FAST_ErrorCode HMS_FAST_FFT_CreateConfig (FAST_FFTConfig** config, const uint32_t log2n)

Description

Creates opaque configuration for FFT (single-precision). log2n is the base-2 logarithm of the number of FFT points and must satisfy 0 < log2n <= FAST_MAX_FFT_LOG2N (that is, 1 to 16).

Since: 26.0.0

Parameters:

Name Description
config Pointer to the opaque FFT configuration FAST_FFTConfig.
log2n Base-2 logarithm of the number of FFT points (that is, transform length N = 1 << log2n). The value must satisfy 0 < log2n <=FAST_MAX_FFT_LOG2N (that is, 1 to 16).

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If log2n is out of range, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_FFT_CreateConfigD()

FAST_ErrorCode HMS_FAST_FFT_CreateConfigD (FAST_FFTConfig** config, const uint32_t log2n)

Description

Creates opaque configuration for FFT (double-precision). log2n is the base-2 logarithm of the number of FFT points and must satisfy 0 < log2n <= FAST_MAX_FFT_LOG2N (that is, 1 to 16). This function is the same as HMS_FAST_FFT_CreateConfig, but is used for double-precision (double) computation, providing higher numerical precision.

Since: 26.0.0

Parameters:

Name Description
config Pointer to the opaque FFT configuration FAST_FFTConfig.
log2n Base-2 logarithm of the number of FFT points (that is, transform length N = 1 << log2n). The value must satisfy 0 < log2n <=FAST_MAX_FFT_LOG2N (that is, 1 to 16).

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If config is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If log2n is out of range, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_FFT_DestroyConfig()

void HMS_FAST_FFT_DestroyConfig (FAST_FFTConfig* config)

Description

Destroys the opaque configuration of the FFT and deallocates memory. Accessing this opaque configuration again after destruction is considered undefined behavior.

Since: 26.0.0

Parameters:

Name Description
config To-be-destroyed opaque FFT configuration (FAST_FFTConfig).

Returns:

None

[h2]HMS_FAST_FFT_ForwardTransform()

FAST_ErrorCode HMS_FAST_FFT_ForwardTransform (FAST_FFTConfig* config, const uint32_t length, const float input[], float outputRe[], float outputIm[])

Description

Computes the Discrete Fourier Transform (DFT) of a single-precision real time-domain signal. This transform converts a real time-domain signal into a complex frequency-domain signal, ultimately outputting a complex spectrum.

For a real input of length N, the output contains N/2+1 complex frequency components (due to the conjugate symmetry of real-signal spectra, only the first half needs to be stored).

Since: 26.0.0

Parameters:

Name Description
config Valid FFT configuration, which is created by HMS_FAST_FFT_CreateConfig.
length Length of the input signal. The value must be equal to 2^log2n specified during configuration creation.
input Real time-domain input array, whose size is length.
outputRe Real-part array of the complex frequency-domain output, with a size of length/2 + 1.
outputIm Imaginary-part array of the complex frequency-domain output, with a size of length/2 + 1.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If input, outputRe, or outputIm is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If length is not equal to 2^log2n, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_FFT_ForwardTransformD()

FAST_ErrorCode HMS_FAST_FFT_ForwardTransformD (FAST_FFTConfig* config, const uint32_t length, const double input[], double outputRe[], double outputIm[])

Description

Computes the DFT of a double-precision real time-domain signal. This function is the same as HMS_FAST_FFT_ForwardTransform, but uses double-precision (double) computation.

Since: 26.0.0

Parameters:

Name Description
config Valid FFT configuration, which is created by HMS_FAST_FFT_CreateConfigD.
length Length of the input signal. The value must be equal to 2^log2n.
input Real time-domain input array, whose size is length.
outputRe Real-part array of the complex frequency-domain output, with a size of length/2 + 1.
outputIm Imaginary-part array of the complex frequency-domain output, with a size of length/2 + 1.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If input, outputRe, or outputIm is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If length is not equal to 2^log2n, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_FFT_InverseTransform()

FAST_ErrorCode HMS_FAST_FFT_InverseTransform (FAST_FFTConfig* config, const uint32_t length, const float inputRe[], const float inputIm[], float output[])

Description

Computes the Inverse Discrete Fourier Transform (IDFT) of a single-precision complex frequency-domain sequence. It converts a frequency-domain signal back to its time-domain representation.

Since: 26.0.0

Parameters:

Name Description
config Valid FFT configuration, which is created by HMS_FAST_FFT_CreateConfig.
length Length of the output signal. The value must be equal to 2^log2n.
inputRe Real-part array of the complex frequency-domain input, with a size of length/2 + 1.
inputIm Imaginary-part array of the complex frequency-domain input, with a size of length/2 + 1.
output Real time-domain output array, whose size is length.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If inputRe, inputIm, or output is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If length is not equal to 2^log2n, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_FFT_InverseTransformD()

FAST_ErrorCode HMS_FAST_FFT_InverseTransformD (FAST_FFTConfig* config, const uint32_t length, const double inputRe[], const double inputIm[], double output[])

Description

Computes the IDFT of a double-precision complex frequency-domain sequence. This function is the same as HMS_FAST_FFT_InverseTransform, but uses double-precision (double) computation.

Since: 26.0.0

Parameters:

Name Description
config Valid FFT configuration, which is created by HMS_FAST_FFT_CreateConfigD.
length Length of the output signal. The value must be equal to 2^log2n.
inputRe Real-part array of the complex frequency-domain input, with a size of length/2 + 1.
inputIm Imaginary-part array of the complex frequency-domain input, with a size of length/2 + 1.
output Real time-domain output array, whose size is length.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If inputRe, inputIm, or output is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If length is not equal to 2^log2n, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

[h2]HMS_FAST_ConcurrentHashmap_Create()

FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Create(
    FAST_ConcurrentHashmapHandle* handle,
    HMS_FAST_ConcurrentHashmap_HashFunc hasher,
    HMS_FAST_ConcurrentHashmap_KeyEqualFunc equaler,
    float maxLoadFac,
    size_t numShards
)

Description

Creates a concurrent hash map based on the input configuration.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.
hasher Custom hash computation callback function.
equaler Custom key comparison callback function.
maxLoadFac Initial maximum load factor.
numShards Initial number of shards.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle or the related callback function is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the memory is exhausted and the creation fails, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_ConcurrentHashmap_Destroy()

void HMS_FAST_ConcurrentHashmap_Destroy(FAST_ConcurrentHashmapHandle handle)

Description

Destroys a specified concurrent hash map.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to the concurrent hash map to be destroyed.

[h2]HMS_FAST_ConcurrentHashmap_Insert()

FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Insert(
    FAST_ConcurrentHashmapHandle handle,
    const FAST_ConcurrentHashmapKeyPtr key,
    const FAST_ConcurrentHashmapValuePtr value,
    FAST_ConcurrentHashmapValuePtr* originValue
)

Description

Inserts a given key-value pair into a concurrent hash map. If the given key already exists in the hash map, its original value is overwritten.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.
key Pointer to the key to be inserted.
value Pointer to the value to be inserted.
originValue Pointer to the value to be overwritten. This parameter is valid only when FAST_ERROR_CODE_KEY_EXISTS is returned. If this parameter is not required, pass NULL.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the same key exists in the hash map, the existing value is overwritten by the new value and FAST_ERROR_CODE_KEY_EXISTS is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_ConcurrentHashmap_Find()

FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Find(
    FAST_ConcurrentHashmapHandle handle,
    const FAST_ConcurrentHashmapKeyPtr key,
    FAST_ConcurrentHashmapValuePtr* value
)

Description

Searches for the value of a given key in a concurrent hash map and saves the result in the memory pointed to by the value pointer.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.
key Pointer to the key to be searched for.
value Pointer to the search result.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle, key, or value is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If no matching key exists in the hash map, FAST_ERROR_CODE_KEY_NOT_EXISTS is returned.

[h2]HMS_FAST_ConcurrentHashmap_Erase()

FAST_ErrorCode HMS_FAST_ConcurrentHashmap_Erase(
    FAST_ConcurrentHashmapHandle handle,
    const FAST_ConcurrentHashmapKeyPtr key,
    FAST_ConcurrentHashmapKeyPtr* originKey,
    FAST_ConcurrentHashmapValuePtr* originValue
)

Description

Deletes a given key and its value from a concurrent hash map and saves them in originalKey and originalValue for memory management. In actual use, you can also set originalKey and originalValue to NULL as required. In this case, the addresses of the key or value will not be returned.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.
key Pointer to the key to be deleted.
originKey Pointer to the key stored in the hash map. The parameter can be NULL.
originValue Pointer to the value stored in the hash map. The parameter can be NULL.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle or key is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If no matching key exists in the hash map, FAST_ERROR_CODE_KEY_NOT_EXISTS is returned.

[h2]HMS_FAST_ConcurrentHashmap_TryInsert()

FAST_ErrorCode HMS_FAST_ConcurrentHashmap_TryInsert(
    FAST_ConcurrentHashmapHandle handle,
    const FAST_ConcurrentHashmapKeyPtr key,
    const FAST_ConcurrentHashmapValuePtr value
)

Description

Inserts a given key-value pair into a concurrent hash map. If the given key already exists in the hash map, the insertion is aborted and the map remains unchanged.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.
key Pointer to the key to be inserted.
value Pointer to the value to be inserted.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle, key, or value is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the same key exists in the hash map, no operation is performed and FAST_ERROR_CODE_KEY_EXISTS is returned.

[h2]HMS_FAST_ConcurrentHashmap_Size()

size_t HMS_FAST_ConcurrentHashmap_Size(FAST_ConcurrentHashmapHandle handle)

Description

Returns the number of elements in a given concurrent hash map.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.

Returns:

Number of elements in the given concurrent hash map. Note that the return value may slightly differ from the actual value under heavy concurrent operations.

[h2]HMS_FAST_ConcurrentHashmap_Clear()

void HMS_FAST_ConcurrentHashmap_Clear(FAST_ConcurrentHashmapHandle handle)

Description

Clears all elements in the concurrent hash map.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.

[h2]HMS_FAST_ConcurrentHashmap_EraseIf()

size_t HMS_FAST_ConcurrentHashmap_EraseIf(
    FAST_ConcurrentHashmapHandle handle,
    HMS_FAST_ConcurrentHashmap_HookFunc condFunc,
    void* condCtx,
    HMS_FAST_ConcurrentHashmap_HookFunc freeFunc,
    void* freeCtx
)

Description

Traverses the hash map and deletes all key-value pairs that meet the given conditions, using the custom freeFunc function to free the memory of the key-value pairs. In practice, freeFunc can be NULL. In this case, you must manage the memory separately. Avoid defining complex logic (such as locking) inside condFunc and freeFunc to prevent deadlocks and other uncontrollable behaviors.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.
condFunc Custom deletion condition callback function.
condCtx Context for the deletion condition callback function.
freeFunc Custom memory deallocation callback function, which can be NULL.
freeCtx Context for the memory deallocation callback function.

Returns:

Number of elements that have been deleted.

[h2]HMS_FAST_ConcurrentHashmap_Traverse()

void HMS_FAST_ConcurrentHashmap_Traverse(
    FAST_ConcurrentHashmapHandle handle,
    HMS_FAST_ConcurrentHashmap_HookFunc condFunc,
    void* condCtx,
    HMS_FAST_ConcurrentHashmap_HookFunc workFunc,
    void* workCtx
)

Description

Traverses the hash map and applies the modifications defined in workFunc to all key-value pairs that satisfy the custom condFunc. If condFunc is NULL, the custom workFunc is applied to all key-value pairs in the map. Avoid defining complex logic (such as locking) inside condFunc and workFunc to prevent deadlocks and other uncontrollable behaviors.

Since: 6.1.1(24)

Parameters:

Name Description
handle Handle to a concurrent hash map.
condFunc Custom condition callback function, which can be NULL.
condCtx Context for the condition callback function.
workFunc Custom modification callback function.
workCtx Context for the modification callback function.

[h2]HMS_FAST_Hashmap_Clear()

void HMS_FAST_Hashmap_Clear (FAST_HashmapHandle handle)

Description

Deletes all elements from a hash map.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.

Returns:

None

[h2]HMS_FAST_Hashmap_Create()

FAST_ErrorCode HMS_FAST_Hashmap_Create (FAST_HashmapHandle* handle, HMS_FAST_Hashmap_HashFunc hasher, HMS_FAST_Hashmap_KeyEqualFunc equaler)

Description

Creates a hash map based on the input configuration.

Since: 26.0.0

Parameters:

Name Description
handle Pointer to the handle to the created hash map.
hasher Custom hash calculation callback function.
equaler Custom key comparison callback function.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle or the related callback function is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the memory is exhausted and the creation fails, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_Hashmap_Destroy()

void HMS_FAST_Hashmap_Destroy (FAST_HashmapHandle handle)

Description

Destroys a specified concurrent hash map.

Since: 26.0.0

Parameters:

Name Description
handle Handle to the hash map to be destroyed.

Returns:

None

NOTE

This function does not free memory associated with keys or values. The caller retains ownership of all key and value resources and must explicitly free them to avoid memory leaks.

[h2]HMS_FAST_Hashmap_Erase()

FAST_ErrorCode HMS_FAST_Hashmap_Erase (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, FAST_HashmapKeyPtr* originKey, FAST_HashmapValuePtr* originValue)

Description

Deletes an entry from a hash map by key.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.
key Key of the entry to be deleted.
originKey Pointer to the key to be deleted. This parameter is valid only when the operation is successful. If this parameter is not required, pass NULL.
originValue Pointer to the value to be deleted. This parameter is valid only when the operation is successful. If this parameter is not required, pass NULL.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle or key is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If no matching key exists in the hash map, FAST_ERROR_CODE_KEY_NOT_EXISTS is returned.

NOTE

The memory will not be automatically released. You must use originKey and originValue to manually release the memory.

[h2]HMS_FAST_Hashmap_EraseIf()

size_t HMS_FAST_Hashmap_EraseIf (FAST_HashmapHandle handle, HMS_FAST_Hashmap_HookFunc condFunc, void* condCtx, HMS_FAST_Hashmap_HookFunc freeFunc, void* freeCtx)

Description

Deletes all elements that meet the given condition.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.
condFunc Custom deletion condition callback function.
condCtx Context for the deletion condition callback function.
freeFunc Custom memory deallocation callback function, which can be NULL.
freeCtx Context for the memory deallocation callback function.

Returns:

Number of elements that are successfully deleted.

[h2]HMS_FAST_Hashmap_Find()

FAST_ErrorCode HMS_FAST_Hashmap_Find (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, FAST_HashmapValuePtr* value)

Description

Retrieves the value associated with the given key.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.
key Key to be searched for.
value Pointer to the retrieved value.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle, key, or value is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If no matching key exists in the hash map, FAST_ERROR_CODE_KEY_NOT_EXISTS is returned.

[h2]HMS_FAST_Hashmap_Insert()

FAST_ErrorCode HMS_FAST_Hashmap_Insert (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, const FAST_HashmapValuePtr value, FAST_HashmapValuePtr* originValue)

Description

Inserts or updates a key-value pair in the hash map.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.
key Key to be inserted or updated.
value Value of the key.
originValue Pointer to the value to be overwritten. This parameter is valid only when FAST_ERROR_CODE_KEY_EXISTS is returned. If this parameter is not required, pass NULL.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the same key exists in the hash map, the existing value is overwritten by the new value and FAST_ERROR_CODE_KEY_EXISTS is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

NOTE

[h2]HMS_FAST_Hashmap_Size()

size_t HMS_FAST_Hashmap_Size (FAST_HashmapHandle handle)

Description

Returns the number of key-value pairs currently stored in the hash map.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.

Returns:

Number of elements in the hash map.

[h2]HMS_FAST_Hashmap_Traverse()

void HMS_FAST_Hashmap_Traverse (FAST_HashmapHandle handle, HMS_FAST_Hashmap_HookFunc condFunc, void* condCtx, HMS_FAST_Hashmap_HookFunc workFunc, void* workCtx)

Description

Iterates through the hash map, optionally filtering elements and applying a worker function.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.
condFunc Optional condition function. If provided, workFunc is called on an entry only when condFunc returns a non-zero value. Pass NULL to apply workFunc to all entries.
condCtx Custom context to supply custom data needed by condFunc during execution.
workFunc Function to be applied to a selected entry.
workCtx Custom context to supply custom data needed by workFunc during execution.

Returns:

None

NOTE

Both condFunc and workFunc are called under internal locks. Avoid blocking or re-entering the hash map API within these callbacks.

[h2]HMS_FAST_Hashmap_TryInsert()

FAST_ErrorCode HMS_FAST_Hashmap_TryInsert (FAST_HashmapHandle handle, const FAST_HashmapKeyPtr key, const FAST_HashmapValuePtr value)

Description

Inserts a key-value pair only if the key does not exist.

Since: 26.0.0

Parameters:

Name Description
handle Handle to a hash map.
key Key to be inserted.
value Value of the key.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If handle, key, or value is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the same key exists in the hash map, no operation is performed and FAST_ERROR_CODE_KEY_EXISTS is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

NOTE

The caller manages the lifecycle of the key and value memory.

[h2]HMS_FAST_Algo_Sort()

FAST_ErrorCode HMS_FAST_Algo_Sort (HMS_FAST_SortData * data, HMS_FAST_Sort_CompFunc comp)

Description

Fully sorts an array of arbitrary type using a user-provided comparison function.

Since: 26.0.0

Parameters:

Name Description
data Descriptor of the data to be sorted. data->data cannot be NULL, data->sizeOf must be greater than 0, and data->length must be greater than 0.
comp Custom comparison function. The value cannot be null.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If data->sizeOf or data->length is 0, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If data, data->data, or comp is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_Algo_PartialSortAt()

FAST_ErrorCode HMS_FAST_Algo_PartialSortAt (HMS_FAST_SortData * data, size_t offset, size_t count, HMS_FAST_Sort_CompFunc comp)

Description

Performs an in-place partial sort on an array, ensuring that the specified range [offset, offset + count) contains the sorted elements for those positions.

Function description:

Since: 26.0.0

Parameters:

Name Description
data Descriptor of the data to be sorted. The requirements are the same as HMS_FAST_Algo_Sort.
offset Start index of the subarray.
count Number of elements in the subarray.
comp Custom comparison function. The value cannot be null.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If data->sizeOf or data->length is 0, or (offset+count) is out of range, FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If data, data->data, or comp is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the memory is exhausted, FAST_ERROR_CODE_OOM is returned.

[h2]HMS_FAST_Algo_NaturalSort()

FAST_ErrorCode HMS_FAST_Algo_NaturalSort (HMS_FAST_SortData * data, int32_t ascend)

Description

Sorts an array of UTF-8 encoded C-strings using natural language rules.

Since: 26.0.0

Parameters:

Name Description
data Descriptor of the data to be sorted. data->data cannot be NULL, data->sizeOf must be greater than 0, and data->length must be greater than 0. Note: data->sizeOf must be equal to sizeof(char*).
ascend Sorting order. A non-zero value indicates ascending order, and zero indicates descending order.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If data->length is 0, or data->sizeOf is not equal to sizeof(char*), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If data or data->data is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the execution fails due to an error reported by the referenced third-party library, FAST_ERROR_CODE_FAIL is returned.

NOTE

[h2]HMS_FAST_Algo_NaturalPartialSortAt()

FAST_ErrorCode HMS_FAST_Algo_NaturalPartialSortAt (HMS_FAST_SortData * data, size_t offset, size_t count, int32_t ascend)

Description

Partially sorts an array of UTF-8 encoded C-strings using natural language rules, ensuring that the specified range [offset, offset + count) contains the sorted elements for those positions.

Since: 26.0.0

Parameters:

Name Description
data Descriptor of the data to be sorted. The requirements are the same as HMS_FAST_Algo_NaturalSort.
offset Start index of the subarray.
count Number of elements in the subarray.
ascend Sorting order. A non-zero value indicates ascending order, and zero indicates descending order.

Returns:

If the operation is successful, FAST_ERROR_CODE_SUCCESS is returned.

If data->length is 0, (offset+count) is out of range, or data->sizeOf is not equal to sizeof(char*), FAST_ERROR_CODE_ILLEGAL_INPUT is returned.

If data or data->data is NULL, FAST_ERROR_CODE_INVALID_PTR is returned.

If the execution fails due to an error reported by the referenced third-party library, FAST_ERROR_CODE_FAIL is returned.

[h2]HMS_FAST_PerfHintConfigBuilder_Create()

HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_Create (HMS_FAST_PerfHintConfigBuilder** builder)

Description

Creates a builder instance.

Since: 26.0.0

Parameters:

Name Description
builder Reference to the created builder instance.

Returns:

If the operation is successful, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS is returned.

If the parameter is invalid, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM is returned.

If memory is insufficient to allocate a new instance, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_NO_MEMORY is returned.

[h2]HMS_FAST_PerfHintConfigBuilder_Destroy()

void HMS_FAST_PerfHintConfigBuilder_Destroy (HMS_FAST_PerfHintConfigBuilder* builder)

Description

Destroys a builder.

Since: 26.0.0

Parameters:

Name Description
builder Pointer to the builder instance.

[h2]HMS_FAST_PerfHintConfigBuilder_SetSceneType()

HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetSceneType (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_SchedulingOptimization_SceneType sceneType)

Description

Sets the scenario type requiring system performance optimization.

Since: 26.0.0

Parameters:

Name Description
builder Pointer to the builder instance.
sceneType Scenario type requiring system performance optimization.

Returns:

If the operation is successful, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS is returned.

If the parameter is invalid, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM is returned.

[h2]HMS_FAST_PerfHintConfigBuilder_SetSceneState()

HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetSceneState (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_SchedulingOptimization_SceneState sceneState)

Description

Sets the scenario state for system performance optimization.

Since: 26.0.0

Parameters:

Name Description
builder Pointer to the builder instance.
sceneState Scenario state for system performance optimization.

Returns:

If the operation is successful, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS is returned.

If the parameter is invalid, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM is returned.

[h2]HMS_FAST_PerfHintConfigBuilder_SetDurationType()

HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetDurationType (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_SchedulingOptimization_DurationType durationType)

Description

Sets the duration for system performance optimization.

Since: 26.0.0

Parameters:

Name Description
builder Pointer to the builder instance.
durationType Duration for system performance optimization.

Returns:

If the operation is successful, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS is returned.

If the parameter is invalid, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM is returned.

[h2]HMS_FAST_PerfHintConfigBuilder_SetTids()

HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_SetTids (HMS_FAST_PerfHintConfigBuilder* builder, int* tids, uint32_t tidsSize)

Description

Sets the IDs of the threads to be optimized.

Since: 26.0.0

Parameters:

Name Description
builder Pointer to the builder instance.
tids Array of thread IDs to be optimized.
tidsSize Size of the thread ID array. The maximum length is 16.

Returns:

If the operation is successful, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS is returned.

If the parameter is invalid, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM is returned.

[h2]HMS_FAST_PerfHintConfigBuilder_Build()

HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_PerfHintConfigBuilder_Build (HMS_FAST_PerfHintConfigBuilder* builder, HMS_FAST_PerfHintConfig** config)

Description

Creates configuration parameters for system performance optimization.

Since: 26.0.0

Parameters:

Name Description
builder Pointer to the builder instance.
config Pointer to the system performance optimization configuration parameter object.

Returns:

If the operation is successful, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS is returned.

If memory is insufficient to allocate a new instance, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_NO_MEMORY is returned.

If the parameter is invalid, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM is returned.

[h2]HMS_FAST_PerfHintConfig_Destroy()

void HMS_FAST_PerfHintConfig_Destroy (HMS_FAST_PerfHintConfig* config)

Description

Destroys configuration parameters for system performance optimization.

Since: 26.0.0

Parameters:

Name Description
config Pointer to the parameter instance.

[h2]HMS_FAST_SchedulingOptimization_PerfHint()

HMS_FAST_SchedulingOptimization_ErrorCode HMS_FAST_SchedulingOptimization_PerfHint (const HMS_FAST_PerfHintConfig* config)

Description

System performance optimization API.

Since: 26.0.0

Parameters:

Name Description
config Pointer to the configuration parameters for system performance optimization.

Returns:

If the operation is successful, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_SUCCESS is returned.

If the system is heavily loaded, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_HIGH_SYSTEM_LOAD is returned.

If the device is in power saving mode, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_POWER_SAVING_MODE is returned.

If the device is in low power mode, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_LOW_POWER_MODE is returned.

If the API is not called in the foreground, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_NON_FRONTEND is returned.

If the interval does not meet the requirements, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INTERVAL is returned.

If system performance optimization fails, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_EXECUTE_ERROR is returned.

If the parameter is invalid, HMS_FAST_ERR_SCHEDULING_OPTIMIZATION_INVALID_PARAM is returned.