Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

cblas_?asum

Computes the sum of magnitudes of the vector elements.

Syntax

float cblas_sasum (const MKL_INT n, const float *x, const MKL_INT incx);

float cblas_scasum (const MKL_INT n, const void *x, const MKL_INT incx);

double cblas_dasum (const MKL_INT n, const double *x, const MKL_INT incx);

double cblas_dzasum (const MKL_INT n, const void *x, const MKL_INT incx);

Include Files

  • mkl.h

Description

The ?asum routine computes the sum of the magnitudes of elements of a real vector, or the sum of magnitudes of the real and imaginary parts of elements of a complex vector:

res = |Re x1| + |Im x1| + |Re x2| + Im x2|+ ... + |Re xn| + |Im xn|,

where x is a vector with n elements.

Input Parameters

n

Specifies the number of elements in vector x.

x

Array, size at least (1 + (n-1)*abs(incx)).

incx

Specifies the increment for indexing vector x.

Output Parameters

res

Contains the sum of magnitudes of real and imaginary parts of all elements of the vector.

Return Values

Contains the sum of magnitudes of real and imaginary parts of all elements of the vector.