-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Instead of calling DAXPY, you can use STL like this to do the same thing:
std::transform( std::begin(A), std::end(A), std::begin(C), std::begin(A),
[scalar](auto&& x, auto&& y) {
return x + scalar * y; // A[i] += scalar * C[i]
}
);
You can use std::reduce, std::inner_product, and std::transform_reduce for inner products. I can write examples if you want.
The reason is that this is idiomatic C++, but also, having the code visible to the C++ compiler rather than via a BLAS library can make optimization better in some cases. There are also GPU implications I can discuss another time.
Metadata
Metadata
Assignees
Labels
No labels