Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
is_all_true.hpp File Reference

Boolean reduction algorithm for checking if all elements are non-zero. More...

#include "shambackends/DeviceBuffer.hpp"
#include "shambackends/sycl.hpp"
#include <vector>
Include dependency graph for is_all_true.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shamalgs
 namespace to contain everything implemented by shamalgs
namespace  shamalgs::primitives
 namespace for primitive algorithm (e.g. sort, scan, reductions, ...)

Functions

template<class T>
bool shamalgs::primitives::is_all_true (sycl::buffer< T > &buf, u32 cnt)
 Check if all elements in a sycl::buffer are non-zero.
template<class T>
bool shamalgs::primitives::is_all_true (sham::DeviceBuffer< T > &buf, u32 cnt)
 Check if all elements in a sham::DeviceBuffer are non-zero.

Detailed Description

Boolean reduction algorithm for checking if all elements are non-zero.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

This header provides parallel algorithms to check if all elements in a buffer are non-zero (logically true). The functions perform a boolean reduction operation across the entire buffer, returning true only if every element satisfies the non-zero condition.

The algorithms come in two variants:

  • is_all_true for sycl::buffer: Direct buffer-based processing
  • is_all_true for sham::DeviceBuffer: USM-based processing

Definition in file is_all_true.hpp.