Skip to content

Add runtime batch_bool mask overloads for complex batch load/store - #1391

Merged
JohanMabille merged 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:masked-load-store-runtime-masks
Jul 29, 2026
Merged

Add runtime batch_bool mask overloads for complex batch load/store#1391
JohanMabille merged 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:masked-load-store-runtime-masks

Conversation

@DiamonDinoia

Copy link
Copy Markdown
Contributor

The scalar batch<T, A> already accepted both batch_bool_constant (compile-time) and batch_bool (runtime) masks for load/store, but batch<std::complex, A> was missing the runtime overloads. This made it impossible to use a dynamic mask with complex batches.

Simple naive implementation for now just API parity.

The scalar batch<T, A> already accepted both batch_bool_constant (compile-time)
and batch_bool (runtime) masks for load/store, but batch<std::complex<T>, A>
was missing the runtime overloads.  This made it impossible to use a dynamic
mask with complex batches.

Changes:
- Declare and define load(value_type const*, batch_bool<T,A>, Mode)
  and store(value_type*, batch_bool<T,A>, Mode) for batch<std::complex<T>>.
- Implement both with a scalar fallback: load zeroes inactive lanes,
  store only writes active lanes.
- Add runtime-mask load/store tests in test_batch_complex.cpp.

The existing free-function API in xsimd_api.hpp already documented that
batch_bool overloads exist and are slower than batch_bool_constant; no
documentation or comment churn in the headers was needed.
@JohanMabille
JohanMabille merged commit 13b9bbe into xtensor-stack:master Jul 29, 2026
87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants