Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 11/07/2023
Public

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

Document Table of Contents

cblas_?axpy_batch_strided

Computes a group of vector-scalar products added to a vector.

Syntax

void cblas_saxpy_batch_strided (const MKL_INT n, const float alpha, const float *x, const MKL_INT incx, const MKL_INT stridex, float *y, const MKL_INT incy, const MKL_INT stridey, const MKL_INT batch_size);

void cblas_daxpy_batch_strided (const MKL_INT n, const double alpha, const double *x, const MKL_INT incx, const MKL_INT stridex, double *y, const MKL_INT incy, const MKL_INT stridey, const MKL_INT batch_size);

void cblas_caxpy_batch_strided (const MKL_INT n, const void alpha, const void *x, const MKL_INT incx, const MKL_INT stridex, void *y, const MKL_INT incy, const MKL_INT stridey, const MKL_INT batch_size);

void cblas_zaxpy_batch_strided (const MKL_INT n, const void alpha, const void *x, const MKL_INT incx, const MKL_INT stridex, void *y, const MKL_INT incy, const MKL_INT stridey, const MKL_INT batch_size);

Include Files

  • mkl.h

Description

The cblas_?axpy_batch_strided routines perform a series of scalar-vector product added to a vector. They are similar to the cblas_?axpy routine counterparts, but the cblas_?axpy_batch_strided routines perform vector operations with a group of vectors.

All vector x (respectively, y) have the same parameters (size, increments) and are stored at constant stridex (respectively, stridey) from each other. The operation is defined as

For i = 0 … batch_size – 1
    X and Y are vectors at offset i * stridex and i * stridey in x and y
    Y = alpha * X + Y
end for

Input Parameters

n

Number of elements in vectors x and y.

alpha

Specifies the scalar alpha.

x

Array of size at least stridex*batch_size holding the x vectors.

incx

Specifies the increment for the elements of x.

stridex

Stride between two consecutive x vectors; must be at least zero.

y

Array of size at least stridey*batch_size holding the y vectors.

incy

Specifies the increment for the elements of y.

stridey

Stride between two consecutive y vectors; must be at least (1 + (n-1)*abs(incy)).

batch_size

Number of axpy computations to perform and x and y vectors. Must be at least 0.

Output Parameters

y

Array holding the batch_size updated vector y.