Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_compat_cuda.h
| Show All 31 Lines | |||||
| /* Manual definitions so we can compile without CUDA toolkit. */ | /* Manual definitions so we can compile without CUDA toolkit. */ | ||||
| typedef unsigned int uint32_t; | typedef unsigned int uint32_t; | ||||
| typedef unsigned long long uint64_t; | typedef unsigned long long uint64_t; | ||||
| typedef unsigned short half; | typedef unsigned short half; | ||||
| typedef unsigned long long CUtexObject; | typedef unsigned long long CUtexObject; | ||||
| #ifdef CYCLES_CUBIN_CC | |||||
| #define FLT_MIN 1.175494350822287507969e-38f | # define FLT_MIN 1.175494350822287507969e-38f | ||||
| #define FLT_MAX 340282346638528859811704183484516925440.0f | # define FLT_MAX 340282346638528859811704183484516925440.0f | ||||
| # define FLT_EPSILON 1.192092896e-07F | |||||
| #endif | |||||
| __device__ half __float2half(const float f) | __device__ half __float2half(const float f) | ||||
| { | { | ||||
| half val; | half val; | ||||
| asm("{ cvt.rn.f16.f32 %0, %1;}\n" : "=h"(val) : "f"(f)); | asm("{ cvt.rn.f16.f32 %0, %1;}\n" : "=h"(val) : "f"(f)); | ||||
| return val; | return val; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines | |||||