1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
|
#pragma once
// __clang_cuda_(c)math(.h) also provide `abs` which actually belong in
// cstdlib. We could split them out but for now we just include cstdlib from
// cmath.h which is what the systems I've seen do as well.
#include <cstdlib>
#include <math.h>
double acos(double);
float acos(float);
double acosh(double);
float acosh(float);
double asin(double);
float asin(float);
double asinh(double);
float asinh(float);
double atan2(double, double);
float atan2(float, float);
double atan(double);
float atan(float);
double atanh(double);
float atanh(float);
double cbrt(double);
float cbrt(float);
double ceil(double);
float ceil(float);
double copysign(double, double);
float copysign(float, float);
double cos(double);
float cos(float);
double cosh(double);
float cosh(float);
double erfc(double);
float erfc(float);
double erf(double);
float erf(float);
double exp2(double);
float exp2(float);
double exp(double);
float exp(float);
double expm1(double);
float expm1(float);
double fdim(double, double);
float fdim(float, float);
double floor(double);
float floor(float);
double fma(double, double, double);
float fma(float, float, float);
double fmax(double, double);
float fmax(float, float);
float max(float, float);
double max(double, double);
double fmin(double, double);
float fmin(float, float);
float min(float, float);
double min(double, double);
double fmod(double, double);
float fmod(float, float);
int fpclassify(double);
int fpclassify(float);
double frexp(double, int *);
float frexp(float, int *);
double hypot(double, double);
float hypot(float, float);
int ilogb(double);
int ilogb(float);
bool isfinite(long double);
bool isfinite(double);
bool isfinite(float);
bool isgreater(double, double);
bool isgreaterequal(double, double);
bool isgreaterequal(float, float);
bool isgreater(float, float);
bool isinf(long double);
bool isinf(double);
bool isinf(float);
bool isless(double, double);
bool islessequal(double, double);
bool islessequal(float, float);
bool isless(float, float);
bool islessgreater(double, double);
bool islessgreater(float, float);
bool isnan(long double);
#ifdef USE_ISNAN_WITH_INT_RETURN
int isnan(double);
int isnan(float);
#else
bool isnan(double);
bool isnan(float);
#endif
bool isnormal(double);
bool isnormal(float);
bool isunordered(double, double);
bool isunordered(float, float);
double ldexp(double, int);
float ldexp(float, int);
double lgamma(double);
float lgamma(float);
long long llrint(double);
long long llrint(float);
double log10(double);
float log10(float);
double log1p(double);
float log1p(float);
double log2(double);
float log2(float);
double logb(double);
float logb(float);
double log(double);
float log(float);
long lrint(double);
long lrint(float);
long lround(double);
long lround(float);
long long llround(float); // No llround(double).
double modf(double, double *);
float modf(float, float *);
double nan(const char *);
float nanf(const char *);
double nearbyint(double);
float nearbyint(float);
double nextafter(double, double);
float nextafter(float, float);
double pow(double, double);
double pow(double, int);
float pow(float, float);
float pow(float, int);
double remainder(double, double);
float remainder(float, float);
double remquo(double, double, int *);
float remquo(float, float, int *);
double rint(double);
float rint(float);
double round(double);
float round(float);
double scalbln(double, long);
float scalbln(float, long);
double scalbn(double, int);
float scalbn(float, int);
bool signbit(double);
bool signbit(float);
long double sin(long double);
double sin(double);
float sin(float);
double sinh(double);
float sinh(float);
double sqrt(double);
float sqrt(float);
double tan(double);
float tan(float);
double tanh(double);
float tanh(float);
double tgamma(double);
float tgamma(float);
double trunc(double);
float trunc(float);
namespace std {
using ::acos;
using ::acosh;
using ::asin;
using ::asinh;
using ::atan;
using ::atan2;
using ::atanh;
using ::cbrt;
using ::ceil;
using ::copysign;
using ::cos;
using ::cosh;
using ::erf;
using ::erfc;
using ::exp;
using ::exp2;
using ::expm1;
using ::fdim;
using ::floor;
using ::fma;
using ::fmax;
using ::fmin;
using ::fmod;
using ::fpclassify;
using ::frexp;
using ::hypot;
using ::ilogb;
using ::isfinite;
using ::isgreater;
using ::isgreaterequal;
using ::isinf;
using ::isless;
using ::islessequal;
using ::islessgreater;
using ::isnan;
using ::isnormal;
using ::isunordered;
using ::ldexp;
using ::lgamma;
using ::llrint;
using ::log;
using ::log10;
using ::log1p;
using ::log2;
using ::logb;
using ::lrint;
using ::lround;
using ::llround;
using ::modf;
using ::nan;
using ::nanf;
using ::nearbyint;
using ::nextafter;
using ::pow;
using ::remainder;
using ::remquo;
using ::rint;
using ::round;
using ::scalbln;
using ::scalbn;
using ::signbit;
using ::sin;
using ::sinh;
using ::sqrt;
using ::tan;
using ::tanh;
using ::tgamma;
using ::trunc;
} // namespace std
#define FP_NAN 0
#define FP_INFINITE 1
#define FP_ZERO 2
#define FP_SUBNORMAL 3
#define FP_NORMAL 4
|