diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-05 09:58:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-05 09:58:31 +0300 |
commit | a1c45a453f55fd61072ff31566654cbd03e92428 (patch) | |
tree | 06381c98af570ad348d58bb4b78a7d6fa944188a /intern | |
parent | 23d2f708f312b73186aff4a42e952480413e7096 (diff) | |
parent | f911fb0744a8185745193a252b4115a6d7756102 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/app/cycles_cubin_cc.cpp | 18 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_compat_cuda.h | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/intern/cycles/app/cycles_cubin_cc.cpp b/intern/cycles/app/cycles_cubin_cc.cpp index c1f3974be6d..73d0cd5130c 100644 --- a/intern/cycles/app/cycles_cubin_cc.cpp +++ b/intern/cycles/app/cycles_cubin_cc.cpp @@ -32,6 +32,15 @@ using std::string; using std::vector; +namespace std { + template<typename T> + std::string to_string(const T &n) { + std::ostringstream s; + s << n; + return s.str(); + } +} + class CompilationSettings { public: @@ -75,7 +84,7 @@ bool compile_cuda(CompilationSettings &settings) for(size_t i = 0; i < settings.defines.size(); i++) { options.push_back("-D" + settings.defines[i]); } - + options.push_back("-D__KERNEL_CUDA_VERSION__=" + std::to_string(cuewNvrtcVersion())); options.push_back("-arch=compute_" + std::to_string(settings.target_arch)); options.push_back("--device-as-default-execution-space"); if(settings.fast_math) @@ -150,9 +159,12 @@ bool link_ptxas(CompilationSettings &settings) " --gpu-name sm_" + std::to_string(settings.target_arch) + " -m" + std::to_string(settings.bits); - if(settings.verbose) + if (settings.verbose) + { ptx += " --verbose"; - + printf(ptx.c_str()); + } + int pxresult = system(ptx.c_str()); if(pxresult) { fprintf(stderr, "Error: ptxas failed (%x)\n\n", pxresult); diff --git a/intern/cycles/kernel/kernel_compat_cuda.h b/intern/cycles/kernel/kernel_compat_cuda.h index 7b66bdc169e..900f7fe6a2c 100644 --- a/intern/cycles/kernel/kernel_compat_cuda.h +++ b/intern/cycles/kernel/kernel_compat_cuda.h @@ -37,8 +37,8 @@ typedef unsigned long long uint64_t; typedef unsigned short half; typedef unsigned long long CUtexObject; -#define FLT_MAX 1.175494350822287507969e-38f -#define FLT_MIN 340282346638528859811704183484516925440.0f +#define FLT_MIN 1.175494350822287507969e-38f +#define FLT_MAX 340282346638528859811704183484516925440.0f __device__ half __float2half(const float f) { |