diff options
author | Ray Molenkamp <github@lazydodo.com> | 2018-02-05 01:11:08 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2018-02-05 01:11:08 +0300 |
commit | f8236e48690baad706885ef9150379c34d9236e9 (patch) | |
tree | 654ef4af055636e0c7391df84c1b82418fb4c66f /intern | |
parent | 36c1122b96ca550a541f9cea9ed2673319c7467b (diff) |
cycles: fix cxx11 usage for cycles_cubin_cc
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/app/cycles_cubin_cc.cpp | 18 |
1 files changed, 15 insertions, 3 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); |