-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small Matrix (6x6, F) #399
Conversation
Add the implementation for the new small matrix (and small vector) types and their operators. Specialize for now for the most common type we need in accelerator physics, a 6x6, F-ordered, 1-indexed matrix.
e55bf84
to
b23d94b
Compare
// but many libs, e.g. PyTorch, do not | ||
// support read-only and will raise | ||
// warnings, casting to read-write | ||
d["data"] = py::make_tuple(std::intptr_t(&m.template get<0>()), read_only); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WeiqunZhang should .get
honor the StartIndex in AMReX?
https://github.com/WeiqunZhang/amrex/blob/3fcfcce263bdfdb80297336284b3e9c07c85060d/Src/Base/AMReX_SmallMatrix.H#L392-L398
|
||
auto sm = std::make_unique< SM >(); | ||
auto * src = static_cast<T*>(buf.ptr); | ||
std::copy(src, src + buf.size, &sm->template get<0>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WeiqunZhang same as above (re: start index not honored in .get
)
This comment was marked as resolved.
This comment was marked as resolved.
d615266
to
44c82f0
Compare
/* | ||
make_SmallMatrix< float const, NRows, NCols, ORDER, StartIndex >(m, "float_const"); | ||
make_SmallMatrix< double const, NRows, NCols, ORDER, StartIndex >(m, "double_const"); | ||
make_SmallMatrix< long double const, NRows, NCols, ORDER, StartIndex >(m, "longdouble_const"); | ||
*/ |
Check notice
Code scanning / CodeQL
Commented-out code Note
Add the implementation for the new small matrix (and small vector) types and their operators.
Specialize for now for the most common type we need in accelerator physics, a 6x6, F-ordered, 1-indexed matrix. (X-ref: ECP-WarpX/impactx#736, ECP-WarpX/impactx#743)
cc @cemitch99