Add 3 new element-wise vector operations #413
Conversation
|
If we are using BLAS-like naming scheme as in #411, I suggest we rename the methods as follows: void scaleInv(const Vector* D, Vector* x); // multiply each x[i] with 1./D[i]
void max(const Vector* x, const Vector* y, Vector* z); // z[i] = max(x[i], y[i])
void abs(const Vector* x, Vector* y); // y[i] = abs(x[i])I would allow in I also wouldn't hard-wire block size within kernels. Try something like constexpr index_type block_size = 256;within the proper namespace. |
2a26d63 to
8d6fea5
Compare
1bbdabc to
910c90d
Compare
The rest of the kernels in this module have hard-wired block sizes. |
|
Should be ready to review |
pelesh
left a comment
There was a problem hiding this comment.
I fixed issues with HIP and CUDA kernels. Would like review by @shakedregev before merging.
shakedregev
left a comment
There was a problem hiding this comment.
Fix the naming stuff, otherwise looks good. I still need to run it.
|
@shakedregev Can you show me where the floating point conventions are described? There are several other |
You're correct that the rules don't say that. We will update them. Almost everywhere in the code, including in the file we wrote |
Description
Add a new vector operations:
scaleInvwhich performs likescale, but scales by the inverse of a diagonal matrix.maxwhich computes a vector whose elements are the maximum of the corresponding elements in the two input vectors.abswhich computes a vector whose elements are the absolute values of the corresponding element in the input vector.Supplants #409 and is based on top of #411
Proposed changes
N/A
Checklist
make testandmake test_installper testing instructions). Code tested on./examples/<your_example>.exe -hto get instructions how to run examples). Code tested on:-Wall -Wpedantic -Wconversion -Wextra.Further comments
N/A