6#include "battery/memory.hpp"
10template <
class Mem>
class B;
25 using value_type = bool;
26 using memory_type = Mem;
30 using this_type2 =
B<M>;
32 using local_type = this_type2<battery::local_memory>;
34 constexpr static const bool sequential = Mem::sequential;
35 constexpr static const bool is_totally_ordered =
true;
36 constexpr static const bool complemented =
true;
37 constexpr static const char* name =
"B";
40 using atomic_type = memory_type::template atomic_type<value_type>;
44 CUDA
static constexpr local_type bot() {
return false; }
45 CUDA
static constexpr local_type top() {
return true; }
46 CUDA
constexpr B(): val(false) {}
47 CUDA
constexpr B(value_type x): val(x) {}
48 CUDA
constexpr B(
const this_type& other):
B(other.value()) {}
49 constexpr B(this_type&& other) =
default;
52 CUDA
constexpr B(
const this_type2<M>& other):
B(other.value()) {}
58 CUDA
constexpr this_type& operator=(
const this_type2<M>& other) {
59 memory_type::store(val, other.value());
64 CUDA
constexpr this_type& operator=(
const this_type& other) {
65 memory_type::store(val, other.value());
69 CUDA
constexpr this_type& operator=(
bool other) {
74 CUDA
constexpr value_type value()
const {
return memory_type::load(val); }
77 CUDA
constexpr operator value_type()
const {
return value(); }
82 CUDA
constexpr B is_top()
const {
89 CUDA
constexpr B is_bot()
const {
94 CUDA
constexpr void join_top() {
95 memory_type::store(val,
true);
102 CUDA
constexpr bool join(
const this_type2<M1>& other) {
103 if(!value() && other.value()) {
104 memory_type::store(val,
true);
111 CUDA
constexpr void meet_bot() {
112 memory_type::store(val,
false);
119 CUDA
constexpr bool meet(
const this_type2<M1>& other) {
120 if(value() && !other.value()) {
121 memory_type::store(val,
false);
127 CUDA
constexpr bool join(value_type other) {
131 CUDA
constexpr bool meet(value_type other) {
138 CUDA NI
void print()
const {
142 CUDA
constexpr this_type& operator|= (
const this_type& other) {
147 CUDA
constexpr this_type& operator&= (
const this_type& other) {
152 CUDA
constexpr this_type& operator|= (value_type other) {
157 CUDA
constexpr this_type& operator&= (value_type other) {
168template<
class M1,
class M2>
169CUDA
constexpr bool operator<=(
const B<M1>& a,
const B<M2>& b) {
170 return !a.value() || b.value();
173template<
class M1,
class M2>
174CUDA
constexpr bool operator<(
const B<M1>& a,
const B<M2>& b) {
175 return !a.value() && b.value();
178template<
class M1,
class M2>
179CUDA
constexpr bool operator>=(
const B<M1>& a,
const B<M2>& b) {
183template<
class M1,
class M2>
184CUDA
constexpr bool operator>(
const B<M1>& a,
const B<M2>& b) {
188template<
class M1,
class M2>
189CUDA
constexpr bool operator==(
const B<M1>& a,
const B<M2>& b) {
190 return a.value() == b.value();
193template<
class M1,
class M2>
194CUDA
constexpr bool operator!=(
const B<M1>& a,
const B<M2>& b) {
195 return a.value() != b.value();
199std::ostream&
operator<<(std::ostream &s,
const B<M> &a) {
CUDA NI void print(const lala::Sig &sig)
Definition ast.hpp:212
::lala::B<::battery::local_memory > B
Definition b.hpp:12
Definition abstract_deps.hpp:14
std::ostream & operator<<(std::ostream &s, const CartesianProduct< A, As... > &cp)
Definition cartesian_product.hpp:530
CUDA constexpr bool operator==(const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b)
Definition cartesian_product.hpp:503
CUDA constexpr bool operator<(const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b)
Definition cartesian_product.hpp:484
CUDA constexpr bool operator>(const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b)
Definition cartesian_product.hpp:497
CUDA constexpr auto meet(const Interval< L > &, const Interval< K > &)