Project
Loading...
Searching...
No Matches
defines.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_DEFINES_H_
17#define RANS_INTERNAL_COMMON_DEFINES_H_
18
19#include <version>
20
21#ifdef RANS_AVX2
22#error RANS_AVX2 cannot be directly set
23#endif
24#ifdef RANS_SSE
25#error RANS_SSE cannot be directly set
26#endif
27#ifdef RANS_SINGLE_STREAM
28#error RANS_AVX cannot be directly set
29#endif
30#ifdef RANS_COMPAT
31#error RANS_COMPAT cannot be directly set
32#endif
33#ifdef RANS_SIMD
34#error RANS_SIMD cannot be directly set
35#endif
36#ifdef RANS_SSE_ONLY
37#error RANS_SSE_ONLY cannot be directly set
38#endif
39#ifdef RANS_FMA
40#error RANS_FMA cannot be directly set
41#endif
42
43#if (defined(__x86_64__) || defined(__aarch64__))
44#define RANS_COMPAT
45#if defined(__SIZEOF_INT128__)
46#define RANS_SINGLE_STREAM
47#endif // if defined(__SIZEOF_INT128__)
48#endif // if 64 BIT system
49
50#if defined(__x86_64__)
51#if defined(__SSE4_2__)
52#define RANS_SSE
53#endif // SSE4.2
54#if defined(__AVX2__)
55#define RANS_AVX2
56#endif // AVX2
57#endif // x86
58
59#if (defined(RANS_SSE) && !defined(RANS_AVX2))
60#define RANS_SSE_ONLY
61#endif
62
63#if (defined(RANS_SSE) || defined(RANS_AVX2))
64#define RANS_SIMD
65#endif
66
67#if defined(__FMA__)
68#define RANS_FMA
69#endif
70
71#if defined(RANS_ENABLE_PARALLEL_STL) && defined(__cpp_lib_execution)
72#define RANS_PARALLEL_STL
73#endif
74
75#endif /*RANS_INTERNAL_COMMON_DEFINES_H_*/