imatcopy#

Computes an in-place scaled matrix transpose or copy operation using a general dense matrix.

Description

The imatcopy routine performs an in-place scaled matrix copy or transposition.

The operation is defined as:

\[C \leftarrow \alpha * op(C)\]

where:

op(X) is one of op(X) = X, or op(X) = XT, or op(X) = XH,

alpha is a scalar,

C is a matrix to be transformed in place,

and C is m x n on input.

imatcopy supports the following precisions:

T

float

double

std::complex<float>

std::complex<double>

imatcopy (Buffer Version)#

Syntax

namespace oneapi::math::blas::column_major {
    void imatcopy(sycl::queue &queue,
                  oneapi::math::transpose trans,
                  std::int64_t m,
                  std::int64_t n,
                  T alpha,
                  sycl::buffer<T, 1> &matrix_in_out,
                  std::int64_t ld_in,
                  std::int64_t ld_out);
}
namespace oneapi::math::blas::row_major {
    void imatcopy(sycl::queue &queue,
                  oneapi::math::transpose trans,
                  std::int64_t m,
                  std::int64_t n,
                  T alpha,
                  sycl::buffer<T, 1> &matrix_in_out,
                  std::int64_t ld_in,
                  std::int64_t ld_out);
}

Input Parameters

queue

The queue where the routine should be executed.

trans

Specifies op(C), the transposition operation applied to the matrix C. See oneMath defined datatypes for more details.

m

Number of rows of C on input. Must be at least zero.

n

Number of columns of C on input. Must be at least zero.

alpha

Scaling factor for the matrix transposition or copy.

matrix_in_out

Buffer holding the input/output matrix C. Must have size as follows:

trans = transpose::nontrans

trans = transpose::trans or trans = transpose::conjtrans

Column major

Size of array matrix_in_out must be at least max(ld_in, ld_out) * n

Size of array matrix_in_out must be at least max(ld_in``*``n, ld_out``*``m)

Row major

Size of array matrix_in_out must be at least max(ld_in, ld_out) * m

Size of array matrix_in_out must be at least max(ld_in``*``m, ld_out``*``n)

ld_in

The leading dimension of the matrix C on input. It must be positive, and must be at least m if column major layout is used, and at least n if row-major layout is used.

ld_out

The leading dimension of the matrix C on output. It must be positive.

trans = transpose::nontrans

trans = transpose::trans or trans = transpose::conjtrans

Column major

ld_out must be at least m.

ld_out must be at least n.

Row major

ld_out must be at least n.

ld_out must be at least m.

Output Parameters

matrix_in_out

Output buffer, overwritten by alpha * op(C).

Throws

This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.

oneapi::math::invalid_argument

oneapi::math::unsupported_device

oneapi::math::host_bad_alloc

oneapi::math::device_bad_alloc

oneapi::math::unimplemented

imatcopy (USM Version)#

Syntax

namespace oneapi::math::blas::column_major {
    sycl::event imatcopy(sycl::queue &queue,
                         oneapi::math::transpose trans,
                         std::int64_t m,
                         std::int64_t n,
                         value_or_pointer<T> alpha,
                         T *matrix_in_out,
                         std::int64_t ld_in,
                         std::int64_t ld_out,
                         const std::vector<sycl::event> &dependencies = {});
namespace oneapi::math::blas::row_major {
    sycl::event imatcopy(sycl::queue &queue,
                         oneapi::math::transpose trans,
                         std::int64_t m,
                         std::int64_t n,
                         value_or_pointer<T> alpha,
                         T *matrix_in_out,
                         std::int64_t ld_in,
                         std::int64_t ld_out,
                         const std::vector<sycl::event> &dependencies = {});

Input Parameters

queue

The queue where the routine will be executed.

trans

Specifies op(C), the transposition operation applied to the matrix C. See oneMath defined datatypes for more details.

m

Number of rows for the matrix C on input. Must be at least zero.

n

Number of columns for the matrix C on input. Must be at least zero.

alpha

Scaling factor for the matrix transpose or copy operation. See Scalar Arguments in BLAS for more details.

matrix_in_out

Pointer to input/output matrix C. Must have size as follows:

trans = transpose::nontrans

trans = transpose::trans or trans = transpose::conjtrans

Column major

Size of array matrix_in_out must be at least max(ld_in, ld_out) * n

Size of array matrix_in_out must be at least max(ld_in``*``n, ld_out``*``m)

Row major

Size of array matrix_in_out must be at least max(ld_in, ld_out) * m

Size of array matrix_in_out must be at least max(ld_in``*``m, ld_out``*``n)

ld_in

Leading dimension of the matrix C on input. If matrices are stored using column major layout, ld_in must be at least m. If matrices are stored using row major layout, ld_in must be at least n. Must be positive.

ld_out

Leading dimension of the matrix C on output. Must be positive.

trans = transpose::nontrans

trans = transpose::trans or trans = transpose::conjtrans

Column major

ld_out must be at least m.

ld_out must be at least n.

Row major

ld_out must be at least n.

ld_out must be at least m.

dependencies

List of events to wait for before starting computation, if any. If omitted, defaults to no dependencies.

Output Parameters

matrix_in_out

Pointer to output matrix C overwritten by alpha * op(C).

Return Values

Output event to wait on to ensure computation is complete.

Throws

This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.

oneapi::math::invalid_argument

oneapi::math::unsupported_device

oneapi::math::host_bad_alloc

oneapi::math::device_bad_alloc

oneapi::math::unimplemented

Parent topic: BLAS-like Extensions