axpy

high-level axpy (y = alpha * x + y) wrapper for CuPtr

version(grain_cuda)
void
axpy
(
T
)
(
const ref CuArray!T x
,
ref CuArray!T y
,
T alpha = 1
,
int incx = 1
,
int incy = 1
)

Examples

cublas tests

auto a = CuArray!float([3, 4, 5]);
auto b = CuArray!float([1, 2, 3]);
axpy(a, b, 2.0);
assert(a.toHost() == [3, 4, 5]);
assert(b.toHost() == [7, 10, 13]);

Meta