Changes
Page history
Update BLAS
authored
Mar 22, 2023
by
Alfredo Correa
Show whitespace changes
Inline
Side-by-side
BLAS.md
View page @
644a309c
...
...
@@ -4,7 +4,7 @@ All these operations are now supported for CPU and GPU memory, real and complex.
|--- |--- | --- | --- | --- | --- |
| SWAP |
`blas::swap(x, y)`
| $
`x_i \leftrightarrow y_i`
$ |
`(x^y)`
| |
`swap_ranges(begin(x), end(x), begin(y))`
|
| COPY |
`blas::copy(x, y)`
| $
`y_i \leftrightarrow x_i`
$ |
`y << x`
|
`y = blas::copy(x)`
|
`copy(begin(x), end(x), begin(y))`
|
| ASUM |
`blas::asum(x, res)`
| $
`r \leftarrow \sum_i \|\Re x_i\| + \|\Im x_i\|`
$ |
`x==0`
/
`x!=0`
/
`isinf(x)`
/
`isnan(x)`
|
`res = blas::asum(x)`
|
`transform_reduce(begin(x), end(x), 0.0, plus<>{}, [](auto const& e){return abs(e.real()) + abs(e.imag());})`
|
| ASUM |
`blas::asum(x, res)`
| $
`r \leftarrow \sum_i \|\Re x_i\| + \|\Im x_i\|`
$ |
`x==0`
/
`x!=0`
`isinf(x)`
`isnan(x)`
|
`res = blas::asum(x)`
|
`transform_reduce(begin(x), end(x), 0.0, plus<>{}, [](auto const& e){return abs(e.real()) + abs(e.imag());})`
|
| NRM2 |
`blas::
nrm2(x, res)`
| $
`r \leftarrow \sqrt{\sum_i \|x_i\|^2}`
$ |
`abs(x)`
|
`res = blas::nrm2(x);`
|
`sqrt(trasnform_reduce(begin(x), end(x), 0.0, plus<>{}, [](auto const& e){return norm(e);}));`
|
| SCAL |
`blas::scal(aa, x);`
| $
`x_i \leftarrow \alpha x_i`
$ |
`x*=aa;`
| |
`for_each(begin(x), end(x), [aa](auto& e){return e*=aa;})`
|
...
...
...
...