P4 to Git Change 1984520 by vsytchen@vsytchen-remote-ocl-win10 on 2019/08/16 11:35:50

SWDEV-198885 - [CQE][OCL][NAVI10][NAVI14 ] compiler temps not generated

	Blender 2.8 spawns a new process for each kernel to be compiled. This makes saving temporaries impossible, since all of the kernels will have the same file names.

	1. Add a formatting field %pid% to the dump prefix of -save-temps/-save-temps-all. The runtime will replace this field with the PID of the current process.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/17832/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.cpp#45 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.hpp#21 edit


[ROCm/clr commit: 133a9ef59b]
This commit is contained in:
foreman
2019-08-16 11:44:16 -04:00
parent de65e87255
commit 2394de9b37
2 changed files with 14 additions and 1 deletions
@@ -1513,8 +1513,20 @@ static std::string getValidDumpBaseName(const std::string &path, const std::stri
void
Options::setDumpFileName(const char* val)
{
std::string dumpPrefix = oVariables->DumpPrefix;
const size_t pidPos = dumpPrefix.find("%pid%");
if (pidPos != std::string::npos) {
#ifdef _WIN32
const std::int32_t pid = _getpid();
#endif
#ifdef __linux__
const std::int32_t pid = getpid();
#endif
dumpPrefix.replace(pidPos, 5, std::to_string(pid));
}
std::stringstream prefix;
prefix << oVariables->DumpPrefix << "_" << buildNo << "_" << val;
prefix << dumpPrefix << "_" << buildNo << "_" << val;
dumpFileRoot = prefix.str();
// Check whether the length of path meets the system limits
@@ -16,6 +16,7 @@
#include <unistd.h>
#endif
#ifdef _WIN32
#include <process.h>
#include <cstdio>
#endif