some code improvement
This commit is contained in:
@@ -159,24 +159,24 @@ static std::string generatePTX(
|
|||||||
|
|
||||||
/* Create the compiliation unit. */
|
/* Create the compiliation unit. */
|
||||||
NVVMProg prog;
|
NVVMProg prog;
|
||||||
std::vector<const char*> options;
|
|
||||||
|
|
||||||
/* Add libdevice. */
|
/* Add libdevice. */
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const std::string &libDeviceName = getLibDeviceName(computeArch);
|
const std::string &libDeviceName = getLibDeviceName(computeArch);
|
||||||
addFileToProgram(libDeviceName, prog);
|
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)
|
catch (const std::exception &ex)
|
||||||
{
|
{
|
||||||
throw Exception(ex.what());
|
throw Exception(ex.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<const char*> options;
|
||||||
|
for (const auto &f : nvvmFiles)
|
||||||
|
addFileToProgram(f, prog);
|
||||||
|
|
||||||
|
for (const auto &o : nvvmOptions)
|
||||||
|
options.push_back(o.c_str());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -199,8 +199,9 @@ static std::string generatePTX(
|
|||||||
}
|
}
|
||||||
catch (const std::exception &ex)
|
catch (const std::exception &ex)
|
||||||
{
|
{
|
||||||
|
std::cerr << "NVVM exception: " << ex.what() << std::endl;
|
||||||
printWarningsAndErrors(prog);
|
printWarningsAndErrors(prog);
|
||||||
throw Exception(ex.what());
|
throw Exception("");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ptxString;
|
return ptxString;
|
||||||
|
|||||||
Reference in New Issue
Block a user