HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SYS_MathRestrictive.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SYS_ObsoleteFunctions.h ( SYS Library, C++)
7  *
8  * COMMENTS: Since there are SYS versions of many functions, we want to
9  * catch these in our builds. Thus, we want to have defines which
10  * cause compile errors when they are used. This file is included
11  * from SYS_Math. It is turned off during the HDK (since we can
12  * allow users to make std calls.
13  */
14 
15 #ifndef __SYS_ObsoleteFunctions__
16 #define __SYS_ObsoleteFunctions__
17 
18 //#define SYS_RESTRICTIVE_MATH
19 
20 #if defined(SYS_RESTRICTIVE_MATH)
21 
22 #define SYS_RESTRICT_UNARY(name) \
23  static inline fpreal64 name(const fpreal64 x, const int use_sys=0) { return x; } \
24  static inline fpreal32 name##f(const fpreal32 x, const int use_sys=0) { return x; }
25 
26 #define SYS_RESTRICT_BINARY(name) \
27  static inline fpreal64 name(const fpreal64 x, const fpreal64 y, const int use_sys=0) \
28  { return x; } \
29  static inline fpreal32 name##f(const fpreal32 x, const fpreal32 y, const int use_sys=0) \
30  { return x; }
31 
32 SYS_RESTRICT_UNARY(sin)
33 SYS_RESTRICT_UNARY(cos)
34 SYS_RESTRICT_UNARY(tan)
35 SYS_RESTRICT_UNARY(asin)
36 SYS_RESTRICT_UNARY(acos)
37 SYS_RESTRICT_UNARY(atan)
38 SYS_RESTRICT_UNARY(sinh)
39 SYS_RESTRICT_UNARY(cosh)
40 SYS_RESTRICT_UNARY(tanh)
41 SYS_RESTRICT_UNARY(asinh)
42 SYS_RESTRICT_UNARY(acosh)
43 SYS_RESTRICT_UNARY(atanh)
44 
45 SYS_RESTRICT_UNARY(sqrt)
46 SYS_RESTRICT_UNARY(cbrt)
47 SYS_RESTRICT_UNARY(log)
48 SYS_RESTRICT_UNARY(log1p)
49 SYS_RESTRICT_UNARY(log10)
50 SYS_RESTRICT_UNARY(exp)
51 SYS_RESTRICT_UNARY(expm1)
52 
53 SYS_RESTRICT_UNARY(fabs)
54 SYS_RESTRICT_UNARY(trunc)
55 SYS_RESTRICT_UNARY(floor)
56 SYS_RESTRICT_UNARY(ceil)
57 
58 SYS_RESTRICT_BINARY(fmod)
59 SYS_RESTRICT_BINARY(pow)
60 SYS_RESTRICT_BINARY(atan2)
61 SYS_RESTRICT_BINARY(hypot)
62 
63 #endif
64 
65 #endif
IMATH_HOSTDEVICE constexpr int floor(T x) IMATH_NOEXCEPT
Definition: ImathFun.h:112
vfloat4 sqrt(const vfloat4 &a)
Definition: simd.h:7694
ImageBuf OIIO_API pow(const ImageBuf &A, cspan< float > B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE constexpr int trunc(T x) IMATH_NOEXCEPT
Definition: ImathFun.h:126
IMATH_HOSTDEVICE constexpr int ceil(T x) IMATH_NOEXCEPT
Definition: ImathFun.h:119
double cbrt(double x)
OIIO_FORCEINLINE T log(const T &v)
Definition: simd.h:7905