P4 to Git Change 1335811 by lmoriche@lmoriche_opencl_lc on 2016/11/03 03:28:18

SWDEV-105604 - [OCL-LC-PAL] OpenCL program manager for LC on PAL
	- Fix the corrupted HSACO file when using -save-temps/-save-temps-all on Windows.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#20 edit


[ROCm/clr commit: 9227e8ede5]
Αυτή η υποβολή περιλαμβάνεται σε:
foreman
2016-11-03 02:35:28 -05:00
γονέας 7de2ef329d
υποβολή e8886648c6
2 αρχεία άλλαξαν με 10 προσθήκες και 3 διαγραφές
@@ -345,6 +345,7 @@ LightningProgram::compileImpl(
"-c -emit-llvm -target amdgcn-amd-amdhsa-opencl -x cl "
<< driverOptions << " -include opencl-c.h "
<< "\n*/\n\n" << sourceCode;
f.close();
} else {
buildLog_ +=
"Warning: opening the file to dump the OpenCL source failed.\n";
@@ -394,9 +395,11 @@ LightningProgram::compileImpl(
elfSectionType_ = amd::OclElf::LLVMIR;
if (options->isDumpFlagSet(amd::option::DUMP_BC_ORIGINAL)) {
std::ofstream f(options->getDumpFileName("_original.bc").c_str(), std::ios::trunc);
std::ofstream f(options->getDumpFileName("_original.bc").c_str(),
std::ios::binary | std::ios::trunc);
if(f.is_open()) {
f.write(llvmBinary_.data(), llvmBinary_.size());
f.close();
} else {
buildLog_ +=
"Warning: opening the file to dump the compiled IR failed.\n";
@@ -1196,9 +1196,11 @@ LightningProgram::linkImpl(amd::option::Options *options)
}
if (options->isDumpFlagSet(amd::option::DUMP_BC_LINKED)) {
std::ofstream f(options->getDumpFileName("_linked.bc").c_str(), std::ios::trunc);
std::ofstream f(options->getDumpFileName("_linked.bc").c_str(),
std::ios::binary | std::ios::trunc);
if(f.is_open()) {
f.write(linked_bc->Buf().data(), linked_bc->Size());
f.close();
} else {
buildLog_ +=
"Warning: opening the file to dump the linked IR failed.\n";
@@ -1239,9 +1241,11 @@ LightningProgram::linkImpl(amd::option::Options *options)
}
if (options->isDumpFlagSet(amd::option::DUMP_O)) {
std::ofstream f(options->getDumpFileName(".so").c_str(), std::ios::trunc);
std::ofstream f(options->getDumpFileName(".so").c_str(),
std::ios::binary | std::ios::trunc);
if(f.is_open()) {
f.write(out_exec->Buf().data(), out_exec->Size());
f.close();
} else {
buildLog_ +=
"Warning: opening the file to dump the code object failed.\n";