You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a placeholder for an idea I had in mind since quite some time. But unless I am wrong I have not opened a ticket for this yet.
The idea is to add yet another complex typedef, in addition to std, thrust and cucomplex. We can simply create a custom complex class that works for ALL backends (c++, cuda, and possibly alpaka, kokkos, sycl).
The point is that we only really need very basic operations in complex: addition, subtraction, multiplication, division. All of these can be very simply inlined in simple code, and actually some of these ALREADY are inlined in a header for the vector complex class. So essentially this would be an extension to the scalar type (RI) of the present cxtype_v class (RRRRIIII), it should be quite easy to do.
One additional benefit of this approach would be that we can define many methods as constexpr. This would be useful for instance in the definition of hardcoded parameters (issues #23 and #39 and PR #306).
Activity
valassi commentedon Dec 9, 2021
Note: this is IMO a better alternative to trying to use thrust complex also in c++ (#147).
[cxs] add definition of simple complex (cxsmpl) class, issue madgraph…
[-]Simple custom complex class[/-][+]Simple custom complex class (cxsmpl)[/+]valassi commentedon Jan 11, 2022
This is done in #327, which I am about to merge.
Note that I enable cxsmpl by default for c++ but keep thrust for cuda, as these are the fastest options.
The constexpr business for #39 can start off from here but needs more work.
Closing.