40 #ifndef __CLANG_CUDA_RUNTIME_WRAPPER_H__ 41 #define __CLANG_CUDA_RUNTIME_WRAPPER_H__ 43 #if defined(__CUDA__) && defined(__clang__) 56 #pragma push_macro("__THROW") 57 #pragma push_macro("__CUDA_ARCH__") 63 #if !defined(CUDA_VERSION) 64 #error "cuda.h did not define CUDA_VERSION" 65 #elif CUDA_VERSION < 7000 || CUDA_VERSION > 9000 66 #error "Unsupported CUDA version!" 72 #define __CUDA_ARCH__ 350 79 #define __DEVICE_LAUNCH_PARAMETERS_H__ 84 #define __DEVICE_FUNCTIONS_H__ 85 #define __MATH_FUNCTIONS_H__ 86 #define __COMMON_FUNCTIONS_H__ 89 #if CUDA_VERSION < 9000 92 #define __CUDA_LIBDEVICE__ 96 #include "driver_types.h" 97 #include "host_config.h" 98 #include "host_defines.h" 101 #undef __CUDA_LIBDEVICE__ 103 #include "cuda_runtime.h" 110 #define __nvvm_memcpy(s, d, n, a) __builtin_memcpy(s, d, n) 111 #define __nvvm_memset(d, c, n, a) __builtin_memset(d, c, n) 113 #if CUDA_VERSION < 9000 114 #include "crt/device_runtime.h" 116 #include "crt/host_runtime.h" 120 #undef __cxa_vec_ctor 121 #undef __cxa_vec_cctor 122 #undef __cxa_vec_dtor 124 #undef __cxa_vec_new2 125 #undef __cxa_vec_new3 126 #undef __cxa_vec_delete2 127 #undef __cxa_vec_delete 128 #undef __cxa_vec_delete3 129 #undef __cxa_pure_virtual 135 inline __host__
double __signbitd(
double x) {
145 #pragma push_macro("__host__") 147 #define __CUDACC_RTC__ 148 #include "device_functions_decls.h" 149 #undef __CUDACC_RTC__ 153 #define __host__ UNEXPECTED_HOST_ATTRIBUTE 160 #if defined(CU_DEVICE_INVALID) 161 #if !defined(__USE_FAST_MATH__) 162 #define __USE_FAST_MATH__ 0 165 #if !defined(__CUDA_PREC_DIV) 166 #define __CUDA_PREC_DIV 0 174 #pragma push_macro("__forceinline__") 175 #define __forceinline__ __device__ __inline__ __attribute__((always_inline)) 177 #pragma push_macro("__float2half_rn") 178 #if CUDA_VERSION >= 9000 182 #define __float2half_rn __float2half_rn_disabled 185 #include "device_functions.hpp" 186 #pragma pop_macro("__float2half_rn") 195 #pragma push_macro("__USE_FAST_MATH__") 196 #if defined(__CLANG_CUDA_APPROX_TRANSCENDENTALS__) 197 #define __USE_FAST_MATH__ 1 199 #include "math_functions.hpp" 200 #pragma pop_macro("__USE_FAST_MATH__") 202 #include "math_functions_dbl_ptx3.hpp" 203 #pragma pop_macro("__forceinline__") 207 #undef __MATH_FUNCTIONS_HPP__ 209 #include "math_functions.hpp" 213 static inline float rsqrt(
float __a) {
return rsqrtf(__a); }
214 static inline float rcbrt(
float __a) {
return rcbrtf(__a); }
215 static inline float sinpi(
float __a) {
return sinpif(__a); }
216 static inline float cospi(
float __a) {
return cospif(__a); }
217 static inline void sincospi(
float __a,
float *
__b,
float *
__c) {
218 return sincospif(__a, __b, __c);
220 static inline float erfcinv(
float __a) {
return erfcinvf(__a); }
221 static inline float normcdfinv(
float __a) {
return normcdfinvf(__a); }
222 static inline float normcdf(
float __a) {
return normcdff(__a); }
223 static inline float erfcx(
float __a) {
return erfcxf(__a); }
227 static inline __device__
void __brkpt(
int __c) { __brkpt(); }
238 #undef __DEVICE_FUNCTIONS_HPP__ 239 #include "device_atomic_functions.hpp" 240 #include "device_functions.hpp" 241 #include "sm_20_atomic_functions.hpp" 242 #include "sm_20_intrinsics.hpp" 243 #include "sm_32_atomic_functions.hpp" 253 #if CUDA_VERSION >= 8000 254 #include "sm_60_atomic_functions.hpp" 255 #include "sm_61_intrinsics.hpp" 258 #undef __MATH_FUNCTIONS_HPP__ 264 #pragma push_macro("signbit") 265 #pragma push_macro("__GNUC__") 267 #define signbit __ignored_cuda_signbit 272 #pragma push_macro("_GLIBCXX_MATH_H") 273 #pragma push_macro("_LIBCPP_VERSION") 274 #if CUDA_VERSION >= 9000 275 #undef _GLIBCXX_MATH_H 277 #ifdef _LIBCPP_VERSION 278 #define _LIBCPP_VERSION 3700 282 #include "math_functions.hpp" 283 #pragma pop_macro("_GLIBCXX_MATH_H") 284 #pragma pop_macro("_LIBCPP_VERSION") 285 #pragma pop_macro("__GNUC__") 286 #pragma pop_macro("signbit") 288 #pragma pop_macro("__host__") 290 #include "texture_indirect_functions.h" 293 #pragma pop_macro("__CUDA_ARCH__") 294 #pragma pop_macro("__THROW") 306 __device__
int vprintf(
const char *,
const char *);
307 __device__
void free(
void *) __attribute((nothrow));
308 __device__
void *malloc(
size_t) __attribute((nothrow))
__attribute__((malloc));
309 __device__
void __assertfail(
const char *__message,
const char *__file,
310 unsigned __line,
const char *__function,
315 __device__
static inline void __assert_fail(
const char *__message,
316 const char *__file,
unsigned __line,
317 const char *__function) {
318 __assertfail(__message, __file, __line, __function,
sizeof(
char));
323 __device__
int printf(
const char *, ...);
328 __device__
static inline void free(
void *__ptr) { ::free(__ptr); }
329 __device__
static inline void *malloc(
size_t __size) {
330 return ::malloc(__size);
337 __device__
inline __cuda_builtin_threadIdx_t::operator uint3()
const {
345 __device__
inline __cuda_builtin_blockIdx_t::operator uint3()
const {
353 __device__
inline __cuda_builtin_blockDim_t::operator dim3()
const {
354 return dim3(x, y, z);
357 __device__
inline __cuda_builtin_gridDim_t::operator dim3()
const {
358 return dim3(x, y, z);
371 #pragma push_macro("dim3") 372 #pragma push_macro("uint3") 373 #define dim3 __cuda_builtin_blockDim_t 374 #define uint3 __cuda_builtin_threadIdx_t 375 #include "curand_mtgp32_kernel.h" 376 #pragma pop_macro("dim3") 377 #pragma pop_macro("uint3") 378 #pragma pop_macro("__USE_FAST_MATH__") 381 #endif // __CLANG_CUDA_RUNTIME_WRAPPER_H__ __DEVICE__ bool signbit(float __x)
Test for sign bit.
float __ovld __cnfn cospi(float x)
Compute cos (PI * x).
char __v64qi __attribute__((__vector_size__(64)))
float __ovld __cnfn rsqrt(float)
Compute inverse square root.
static __inline__ vector float vector float __b
int printf(__constant const char *st,...)
static __inline__ vector float vector float vector float __c
float __ovld __cnfn sinpi(float x)
Compute sin (PI * x).