Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shambackends
include
shambackends
sycl_builtins.hpp
Go to the documentation of this file.
1
// -------------------------------------------------------//
2
//
3
// SHAMROCK code for hydrodynamics
4
// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5
// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6
// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7
//
8
// -------------------------------------------------------//
9
10
#pragma once
11
18
19
#include "
shambase/integer.hpp
"
20
#include "shambase/vectors.hpp"
21
#include "
shambackends/math.hpp
"
22
#include "
shambackends/sycl.hpp
"
23
#include "
shambackends/vec.hpp
"
24
25
namespace
shambase
{
26
37
template
<
class
T,
int
n, std::enable_if_t<std::is_
int
egral_v<T>,
int
> = 0>
38
i32
any
(sycl::vec<T, n> v) {
39
#ifdef SYCL_COMP_INTEL_LLVM
40
return
sycl::any(v);
41
#else
42
return
sham::sum_accumulate(
43
(v & sycl::vec<T, n>{
most_sig_bit_mask<T>
()}) >> sycl::vec<T, n>{4});
44
#endif
45
}
46
47
}
// namespace shambase
i32
std::int32_t i32
32 bit integer
Definition
aliases_int.hpp:23
integer.hpp
math.hpp
shambase
namespace for basic c++ utilities
Definition
sycl_builtins.hpp:25
shambase::any
i32 any(sycl::vec< T, n > v)
Fallback function for sycl::any SYCL std : Returns 1 if the most significant bit in any component of ...
Definition
sycl_builtins.hpp:38
shambase::most_sig_bit_mask
constexpr T most_sig_bit_mask() noexcept
Generates a mask with only the most significant bit set.
Definition
integer.hpp:149
sycl.hpp
vec.hpp
Generated on
for Shamrock by
1.15.0