rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
access_flags.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "../platform/constexpr.hpp"
6#include "../binary/bit.hpp"
7#include "../binary/flagset.hpp"
8
9#include <ostream>
10
11namespace rexlib
12{
13
14enum class access_flag_bits {
15 read = bit(0),
16 write = bit(1),
17};
18
19using access_flags = flagset<access_flag_bits>;
20
21REXLIB_INLINE_CONST_CONSTEXPR access_flags read_only(access_flag_bits::read);
22REXLIB_INLINE_CONST_CONSTEXPR access_flags write_only(access_flag_bits::write);
23REXLIB_INLINE_CONST_CONSTEXPR access_flags read_write(
24 {access_flag_bits::read, access_flag_bits::write}
25);
26
27REXLIB_CONSTEXPR
28const char* to_string(access_flag_bits v) noexcept;
29
30template<typename T>
31std::basic_ostream<T>& operator<<(std::basic_ostream<T>& os, access_flag_bits v);
32
33} // namespace rexlib
34
35#include "access_flags.inl"
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
REXLIB_NODISCARD REXLIB_CONSTEXPR std::size_t bit(std::size_t i) noexcept
Returns a std::size_t type with a single bit set at the provided index.