Project
Loading...
Searching...
No Matches
defaults.h
Go to the documentation of this file.
1// Copyright 2019-2023 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef RANS_INTERNAL_COMMON_DEFAULTS_H_
17#define RANS_INTERNAL_COMMON_DEFAULTS_H_
18
19#include <cstddef>
20#include <cstdint>
21#include <cstring>
22
24
25#include <cstdint>
26
27namespace o2::rans
28{
29enum class CoderTag : uint8_t { Compat,
31 SSE,
32 AVX2 };
33
34using count_t = uint32_t;
35
36namespace defaults
37{
38
39#if defined(RANS_AVX2)
40inline constexpr o2::rans::CoderTag DefaultTag = o2::rans::CoderTag::AVX2;
41#elif defined(RANS_SSE_ONLY)
42inline constexpr o2::rans::CoderTag DefaultTag = o2::rans::CoderTag::SSE;
43#elif (defined(RANS_SINGLE_STREAM) && !defined(RANS_SIMD))
44inline constexpr o2::rans::CoderTag DefaultTag = o2::rans::CoderTag::SingleStream;
45#elif (defined(RANS_COMPAT) && !defined(RANS_SINGLE_STREAM) && !defined(RANS_SIMD))
46inline constexpr o2::rans::CoderTag DefaultTag = o2::rans::CoderTag::Compat;
47#else
48#error your hardware or compiler settings do not support librans
49#endif
50
51namespace internal
52{
53inline constexpr size_t RenormingLowerBound = 20;
54} // namespace internal
55
56inline constexpr size_t MinRenormPrecisionBits = 10;
57inline constexpr size_t MaxRenormPrecisionBits = 20;
58
59} // namespace defaults
60} // namespace o2::rans
61
62#endif /* RANS_INTERNAL_COMMON_DEFAULTS_H_ */
preprocessor defines to enable features based on CPU architecture
constexpr size_t RenormingLowerBound
Definition defaults.h:53
constexpr size_t MinRenormPrecisionBits
Definition defaults.h:56
constexpr size_t MaxRenormPrecisionBits
Definition defaults.h:57
uint32_t count_t
Definition defaults.h:34