HDK
|
Platform-related macros. More...
Go to the source code of this file.
Enumerations | |
enum | endian { endian::little = __ORDER_LITTLE_ENDIAN__, endian::big = __ORDER_BIG_ENDIAN__, endian::native = __BYTE_ORDER__ } |
Functions | |
OIIO_FORCEINLINE constexpr bool | littleendian (void) |
Return true if the architecture we are running on is little endian. More... | |
OIIO_FORCEINLINE constexpr bool | bigendian (void) |
Return true if the architecture we are running on is big endian. More... | |
void | cpuid (int info[4], int infoType, int extra) |
Retrieve cpuid flags into 'info'. More... | |
bool | cpu_has_sse2 () |
bool | cpu_has_sse3 () |
bool | cpu_has_ssse3 () |
bool | cpu_has_fma () |
bool | cpu_has_sse41 () |
bool | cpu_has_sse42 () |
bool | cpu_has_popcnt () |
bool | cpu_has_avx () |
bool | cpu_has_f16c () |
bool | cpu_has_rdrand () |
bool | cpu_has_avx2 () |
bool | cpu_has_avx512f () |
bool | cpu_has_avx512dq () |
bool | cpu_has_avx512ifma () |
bool | cpu_has_avx512pf () |
bool | cpu_has_avx512er () |
bool | cpu_has_avx512cd () |
bool | cpu_has_avx512bw () |
bool | cpu_has_avx512vl () |
void * | aligned_malloc (std::size_t size, std::size_t align) |
void | aligned_free (void *ptr) |
template<typename T , class... Args> | |
T * | aligned_new (Args &&...args) |
template<typename T > | |
void | aligned_delete (T *t) |
Platform-related macros.
Definition in file platform.h.
#define __has_attribute | ( | x | ) | 0 |
Definition at line 130 of file platform.h.
#define __has_cpp_attribute | ( | x | ) | 0 |
Definition at line 125 of file platform.h.
#define __has_include | ( | x | ) | 0 |
Definition at line 136 of file platform.h.
Definition at line 46 of file platform.h.
Deprecated (for namespace pollution reasons)
Definition at line 194 of file platform.h.
#define OIIO_ALLOCA | ( | type, | |
size | |||
) | ((size) != 0 ? ((type*)alloca((size) * sizeof (type))) : nullptr) |
allocates memory, equivalent of C99 type var_name[size]
Definition at line 191 of file platform.h.
#define OIIO_APPLE_CLANG_VERSION 0 |
Definition at line 166 of file platform.h.
#define OIIO_CACHE_ALIGN OIIO_ALIGN(OIIO_CACHE_LINE_SIZE) |
Definition at line 215 of file platform.h.
#define OIIO_CACHE_LINE_SIZE 64 |
Definition at line 212 of file platform.h.
#define OIIO_CLANG_VERSION 0 |
Definition at line 158 of file platform.h.
#define OIIO_CONST_FUNC |
Definition at line 277 of file platform.h.
#define OIIO_CONSTEXPR constexpr |
Definition at line 115 of file platform.h.
#define OIIO_CONSTEXPR_OR_CONST constexpr |
Definition at line 116 of file platform.h.
#define OIIO_DEPRECATED | ( | msg | ) |
Definition at line 310 of file platform.h.
#define OIIO_FALLTHROUGH |
Definition at line 318 of file platform.h.
#define OIIO_FORCEINLINE inline |
Definition at line 249 of file platform.h.
#define OIIO_GNUC_VERSION 0 |
Definition at line 148 of file platform.h.
#define OIIO_HOSTDEVICE |
Definition at line 348 of file platform.h.
Definition at line 233 of file platform.h.
#define OIIO_MAYBE_UNUSED |
Definition at line 287 of file platform.h.
#define OIIO_MSVS_AT_LEAST_2013 0 |
Definition at line 181 of file platform.h.
#define OIIO_MSVS_AT_LEAST_2015 0 |
Definition at line 183 of file platform.h.
#define OIIO_MSVS_AT_LEAST_2017 0 |
Definition at line 185 of file platform.h.
#define OIIO_MSVS_BEFORE_2013 0 |
Definition at line 182 of file platform.h.
#define OIIO_MSVS_BEFORE_2015 0 |
Definition at line 184 of file platform.h.
#define OIIO_MSVS_BEFORE_2017 0 |
Definition at line 186 of file platform.h.
#define OIIO_NO_SANITIZE_ADDRESS |
Definition at line 339 of file platform.h.
#define OIIO_NODISCARD |
Definition at line 327 of file platform.h.
#define OIIO_NOEXCEPT noexcept |
Definition at line 119 of file platform.h.
#define OIIO_PURE_FUNC |
Definition at line 263 of file platform.h.
#define OIIO_RESTRICT |
Definition at line 299 of file platform.h.
Definition at line 234 of file platform.h.
#define OIIO_UNUSED_OK OIIO_MAYBE_UNUSED |
Definition at line 291 of file platform.h.
|
strong |
Class for describing endianness. Test for endianness as if (endian::native == endian::little)
or if (endian::native == endian::big)
. This uses the same semantics as C++20's std::endian.
Enumerator | |
---|---|
little | |
big | |
native |
Definition at line 358 of file platform.h.
|
inline |
Definition at line 448 of file platform.h.
void* aligned_malloc | ( | std::size_t | size, |
std::size_t | align | ||
) |
|
inline |
Definition at line 441 of file platform.h.
OIIO_FORCEINLINE constexpr bool bigendian | ( | void | ) |
Return true if the architecture we are running on is big endian.
Definition at line 381 of file platform.h.
|
inline |
Definition at line 422 of file platform.h.
|
inline |
Definition at line 425 of file platform.h.
|
inline |
Definition at line 432 of file platform.h.
|
inline |
Definition at line 431 of file platform.h.
|
inline |
Definition at line 427 of file platform.h.
|
inline |
Definition at line 430 of file platform.h.
|
inline |
Definition at line 426 of file platform.h.
|
inline |
Definition at line 428 of file platform.h.
|
inline |
Definition at line 429 of file platform.h.
|
inline |
Definition at line 433 of file platform.h.
|
inline |
Definition at line 423 of file platform.h.
|
inline |
Definition at line 418 of file platform.h.
|
inline |
Definition at line 421 of file platform.h.
|
inline |
Definition at line 424 of file platform.h.
|
inline |
Definition at line 415 of file platform.h.
|
inline |
Definition at line 416 of file platform.h.
|
inline |
Definition at line 419 of file platform.h.
|
inline |
Definition at line 420 of file platform.h.
|
inline |
Definition at line 417 of file platform.h.
Retrieve cpuid flags into 'info'.
Definition at line 389 of file platform.h.
OIIO_FORCEINLINE constexpr bool littleendian | ( | void | ) |
Return true if the architecture we are running on is little endian.
Definition at line 373 of file platform.h.