This repository was archived by the owner on Dec 19, 2025. It is now read-only.
ENH: add suppport for Kokkos::complex Views#61
Merged
IvanGrigorik merged 14 commits intokokkos:mainfrom Nov 11, 2025
Merged
Conversation
Contributor
|
This might actually be a pretty useful change (especially since quantum computing simulation basically works mainly with complex matrix computation) |
Collaborator
|
I fixed some problems, that were related to tests itself and to atomics comparison |
gliga
reviewed
Nov 10, 2025
gliga
reviewed
Nov 10, 2025
gliga
approved these changes
Nov 10, 2025
JBludau
reviewed
Nov 11, 2025
Comment on lines
+141
to
+143
| // Only bind ordering operators for non-complex types | ||
| if constexpr (!is_complex<value_type>::value) { | ||
| _atomic.def( |
Contributor
There was a problem hiding this comment.
thx ... this actually is a problem we still have in core ... complex has only a subset of the operations implemented ...
JBludau
reviewed
Nov 11, 2025
|
|
||
| register_complex_as_numpy_dtype<float>(); | ||
| register_complex_as_numpy_dtype<double>(); | ||
| } No newline at end of file |
Contributor
There was a problem hiding this comment.
This will need to be fixed !!! We should not merge anything that contains these @gliga @IvanGrigorik
Probably best to check your text editors/IDEs for how they end a file
There was a problem hiding this comment.
Since this check is important, why don't we include the check as part of our CI
IvanGrigorik
added a commit
that referenced
this pull request
Nov 14, 2025
* ENH: add suppport for Kokkos::complex Views * ENH: register Kokkos::complex as a numpy dtype * ENH: bind remaining arithmetic operators for complex numbers * ENH: read dtype properly for complex dtypes * ENH: properly format views with complex data types * ENH: fix issue with getting Kokkos::complex offsets when CUDA is enabled * FIX: add back if condition checking for float64 (removed by accident) * complex: fix comples type tests and conversion * fix atomics * formatting * fix atomics comparison * c++ formatting * version: update kokkos version in the comment --------- Co-authored-by: JBludau <104908666+JBludau@users.noreply.github.com> Co-authored-by: Ivan Grigorik <givan502@gmail.com>
IvanGrigorik
added a commit
that referenced
this pull request
Nov 16, 2025
* ENH: add suppport for Kokkos::complex Views * ENH: register Kokkos::complex as a numpy dtype * ENH: bind remaining arithmetic operators for complex numbers * ENH: read dtype properly for complex dtypes * ENH: properly format views with complex data types * ENH: fix issue with getting Kokkos::complex offsets when CUDA is enabled * FIX: add back if condition checking for float64 (removed by accident) * complex: fix comples type tests and conversion * fix atomics * formatting * fix atomics comparison * c++ formatting * version: update kokkos version in the comment --------- Co-authored-by: Nader Al Awar <naderalawar@gmail.com> Co-authored-by: JBludau <104908666+JBludau@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for creating Views of type
Kokkos::complex<float>andKokkos::complex<double>. It also exposes these types to Python such that they can be created and used normally.