seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
compiler_compat.hpp
Go to the documentation of this file.
1// Copyright (c) d-SEAMS developers
2#pragma once
3
4// GNU target attributes and the inline xgetbv stay on GCC and Clang,
5// including clang-cl. MSVC has no target attribute; those kernels take
6// the scalar twin, which uses the same operation order.
7
8#if defined(__GNUC__) || defined(__clang__)
9#define SEAMS_TARGET(spec) __attribute__((target(spec)))
10#define SEAMS_OPTIMIZE(spec) __attribute__((optimize(spec)))
11#define SEAMS_WEAK __attribute__((weak))
12#define SEAMS_NOINLINE __attribute__((noinline))
13#define SEAMS_ALWAYS_INLINE __attribute__((always_inline)) inline
14#define SEAMS_COLD __attribute__((cold))
15#define SEAMS_EXPORT_USED __attribute__((visibility("default"), used))
16#define SEAMS_GNU_TARGET 1
17#else
18#define SEAMS_TARGET(spec)
19#define SEAMS_OPTIMIZE(spec)
20#define SEAMS_WEAK
21#define SEAMS_NOINLINE
22#define SEAMS_ALWAYS_INLINE __forceinline
23#define SEAMS_COLD
24#define SEAMS_EXPORT_USED
25#endif
26
27#if defined(__x86_64__) || defined(__i386__) || defined(_M_X64) || defined(_M_IX86)
28#define SEAMS_HOST_X86 1
29#endif