From c1777bff3b649a98cda6ce44ebef0d92bae73dd5 Mon Sep 17 00:00:00 2001 From: evghenii Date: Thu, 29 Jan 2015 13:16:58 +0100 Subject: [PATCH] some code improvement --- ptxtools/ptxgen.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ptxtools/ptxgen.cpp b/ptxtools/ptxgen.cpp index 6e6d5768..7d764d08 100644 --- a/ptxtools/ptxgen.cpp +++ b/ptxtools/ptxgen.cpp @@ -159,24 +159,24 @@ static std::string generatePTX( /* Create the compiliation unit. */ NVVMProg prog; - std::vector options; /* Add libdevice. */ try { const std::string &libDeviceName = getLibDeviceName(computeArch); addFileToProgram(libDeviceName, prog); - - for (const auto &f : nvvmFiles) - addFileToProgram(f, prog); - - for (const auto &o : nvvmOptions) - options.push_back(o.c_str()); } catch (const std::exception &ex) { throw Exception(ex.what()); } + + std::vector options; + for (const auto &f : nvvmFiles) + addFileToProgram(f, prog); + + for (const auto &o : nvvmOptions) + options.push_back(o.c_str()); try { @@ -199,8 +199,9 @@ static std::string generatePTX( } catch (const std::exception &ex) { + std::cerr << "NVVM exception: " << ex.what() << std::endl; printWarningsAndErrors(prog); - throw Exception(ex.what()); + throw Exception(""); } return ptxString;