HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImathConfig.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 // Copyright Contributors to the OpenEXR Project.
3 
4 // This file is auto-generated by the cmake configure step
5 
6 #ifndef INCLUDED_IMATH_CONFIG_H
7 #define INCLUDED_IMATH_CONFIG_H 1
8 
9 #pragma once
10 
11 //
12 // Options / configuration based on O.S. / compiler
13 //
14 
15 // automated formatting does not handle the cmake tags well
16 // clang-format off
17 
18 //
19 // Define whether the half-to-float conversion should use the lookup
20 // table method. Note that this is overriden by F16C compiler
21 // flags. It is also overrided by the IMATH_HALF_NO_LOOKUP_TABLE
22 // macro, if defined.
23 //
24 #define IMATH_HALF_USE_LOOKUP_TABLE
25 
26 //
27 // Define if the target system has support for large
28 // stack sizes.
29 //
30 /* #undef IMATH_HAVE_LARGE_STACK */
31 
32 //////////////////////
33 //
34 // C++ namespace configuration / options
35 
36 // Current (internal) library namepace name and corresponding public
37 // client namespaces.
38 #define IMATH_INTERNAL_NAMESPACE_CUSTOM 1
39 #define IMATH_INTERNAL_NAMESPACE Imath_3_2_sidefx
40 
41 
42 #define IMATH_NAMESPACE_CUSTOM 1
43 #define IMATH_NAMESPACE Imath
44 
45 
46 //
47 // Version information
48 //
49 #define IMATH_VERSION_STRING "3.2.2"
50 #define IMATH_PACKAGE_STRING "Imath 3.2.2"
51 
52 #define IMATH_VERSION_MAJOR 3
53 #define IMATH_VERSION_MINOR 2
54 #define IMATH_VERSION_PATCH 2
55 #define IMATH_VERSION_RELEASE_TYPE ""
56 
57 #define IMATH_VERSION_HEX \
58  ((uint32_t (IMATH_VERSION_MAJOR) << 24) | \
59  (uint32_t (IMATH_VERSION_MINOR) << 16) | \
60  (uint32_t (IMATH_VERSION_PATCH) << 8))
61 
62 // IMATH_LIB_VERSION is the library API version: SOCURRENT.SOAGE.SOREVISION
63 #define IMATH_LIB_VERSION_STRING "30.3.2.2"
64 
65 // clang-format on
66 
67 //
68 // Code that depends on the v2 ExcMath mechanism of signal handlers
69 // that throw exceptions is incompatible with noexcept, since
70 // floating-point overflow and underflow can occur in a wide variety
71 // of computations within Imath functions now marked with
72 // noexcept. Code that needs to accomodate the exception-handling
73 // behavior can build with the IMATH_USE_NOEXCEPT off.
74 //
75 
76 #define IMATH_USE_NOEXCEPT 1
77 #if IMATH_USE_NOEXCEPT
78 # define IMATH_NOEXCEPT noexcept
79 #else
80 # define IMATH_NOEXCEPT
81 #endif
82 
83 //
84 // By default, opt into the interoparability constructors and assignments.
85 // If this causes problems, it can be disabled by defining this symbol to
86 // be 0 prior to including any Imath headers.
87 //
88 // If no such definition is found, we enable automatically unless we are
89 // using gcc 4.x, which appears to have bugs that prevent the interop
90 // templates from compiling correctly.
91 //
92 #ifndef IMATH_FOREIGN_VECTOR_INTEROP
93 # if defined(__GNUC__) && __GNUC__ == 4 && !defined(__clang__)
94 # define IMATH_FOREIGN_VECTOR_INTEROP 0
95 # else
96 # define IMATH_FOREIGN_VECTOR_INTEROP 1
97 # endif
98 #endif
99 
100 //
101 // Decorator that makes a function available for both CPU and GPU,
102 // when compiling for Cuda or HIP (AMD's Heterogeneous-computing
103 // Interface for Portability).
104 //
105 #if defined(__CUDACC__) || defined(__HIP__)
106 # define IMATH_HOSTDEVICE __host__ __device__
107 #else
108 # define IMATH_HOSTDEVICE
109 #endif
110 
111 //
112 // Some compilers define a special intrinsic to use in conditionals that can
113 // speed up extremely performance-critical spots if the conditional is
114 // usually (or rarely) is true. You use it by replacing
115 // if (x) ...
116 // with
117 // if (IMATH_LIKELY(x)) ... // if you think x will usually be true
118 // or
119 // if (IMATH_UNLIKELY(x)) ... // if you think x will rarely be true
120 //
121 // Caveat: Programmers are notoriously bad at guessing this, so it should be
122 // used only with thorough benchmarking.
123 //
124 #if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
125 # ifdef __cplusplus
126 # define IMATH_LIKELY(x) (__builtin_expect (static_cast<bool> (x), true))
127 # define IMATH_UNLIKELY(x) \
128  (__builtin_expect (static_cast<bool> (x), false))
129 # else
130 # define IMATH_LIKELY(x) (__builtin_expect ((x), 1))
131 # define IMATH_UNLIKELY(x) (__builtin_expect ((x), 0))
132 # endif
133 #else
134 # define IMATH_LIKELY(x) (x)
135 # define IMATH_UNLIKELY(x) (x)
136 #endif
137 
138 // On modern versions of gcc & clang, __has_attribute can test support for
139 // __attribute__((attr)). Make sure it's safe for other compilers.
140 #ifndef __has_attribute
141 # define __has_attribute(x) 0
142 #endif
143 
144 //
145 // Simple way to mark things as deprecated.
146 // When we are sure that C++14 is our true minimum, then we can just
147 // directly use [[deprecated(msg)]].
148 //
149 #if defined(_MSC_VER)
150 # define IMATH_DEPRECATED(msg) __declspec(deprecated (msg))
151 #elif defined(__cplusplus) && __cplusplus >= 201402L
152 # define IMATH_DEPRECATED(msg) [[deprecated (msg)]]
153 #elif defined(__GNUC__) || defined(__clang__)
154 # define IMATH_DEPRECATED(msg) __attribute__ ((deprecated (msg)))
155 #else
156 # define IMATH_DEPRECATED(msg) /* unsupported on this platform */
157 #endif
158 
159 // Whether the user configured the library to have symbol visibility
160 // tagged
161 #define IMATH_ENABLE_API_VISIBILITY
162 
163 // MSVC does not do the same visibility attributes, and when we are
164 // compiling a static library we won't be in DLL mode, but just don't
165 // define these and the export headers will work out
166 #if !defined(_MSC_VER) && defined(IMATH_ENABLE_API_VISIBILITY)
167 # define IMATH_PUBLIC_SYMBOL_ATTRIBUTE \
168  __attribute__ ((__visibility__ ("default")))
169 # define IMATH_PRIVATE_SYMBOL_ATTRIBUTE \
170  __attribute__ ((__visibility__ ("hidden")))
171 // clang differs from gcc and has type visibility which is needed for enums and templates
172 # if __has_attribute(__type_visibility__)
173 # define IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE \
174  __attribute__ ((__type_visibility__ ("default")))
175 # endif
176 #endif
177 
178 #endif // INCLUDED_IMATH_CONFIG_H