2
0

P4 to Git Change 1317781 by lmoriche@lmoriche_opencl_dev on 2016/09/22 19:28:45

SWDEV-94610 - Add runtime support for Printf. Parse the metadata strings and build the PrintInfo structure expected by the runtime.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/amdgpu_metadata.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/amdgpu_metadata.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#10 edit


[ROCm/clr commit: c5b3373da2]
Este cometimento está contido em:
foreman
2016-09-22 19:35:10 -04:00
ascendente 8870b4d28d
cometimento 4624b20760
4 ficheiros modificados com 179 adições e 73 eliminações
+17 -10
Ver ficheiro
@@ -242,8 +242,7 @@ namespace code {
hasMinWavesPerSIMD(false), hasMaxWavesPerSIMD(false),
hasFlatWorkgroupSizeLimits(false),
hasMaxWorkgroupSize(false),
isNoPartialWorkgroups(false),
hasPrintfInfo(false)
isNoPartialWorkgroups(false)
{}
void Metadata::SetCommon(uint8_t mdVersion, uint8_t mdRevision,
@@ -319,9 +318,6 @@ namespace code {
case KeyNoPartialWorkGroups:
isNoPartialWorkgroups = true;
return true;
case KeyPrintfInfo:
hasPrintfInfo = true;
return Read(in, printfInfo);
default:
return false;
}
@@ -374,9 +370,6 @@ namespace code {
if (isNoPartialWorkgroups) {
out << " No partial workgroups" << std::endl;
}
if (hasPrintfInfo) {
out << " Printf info: " << printfInfo << std::endl;
}
out << " Arguments" << std::endl;
for (uint32_t i = 0; i < args.size(); ++i) {
out << " " << i << ": ";
@@ -432,6 +425,12 @@ namespace code {
if (!kernel || !arg) { return false; }
arg = false;
break;
case KeyPrintfInfo: {
std::string formatString;
if (!Read(in, formatString)) { return false; }
printfInfo.push_back(formatString);
break;
}
case KeyKernelName:
case KeyArgSize:
case KeyArgAlign:
@@ -455,7 +454,6 @@ namespace code {
case KeyFlatWorkGroupSizeLimits:
case KeyMaxWorkGroupSize:
case KeyNoPartialWorkGroups:
case KeyPrintfInfo:
if (!kernel) { return false; }
if (!kernel->ReadValue(in, key)) { return false; }
break;
@@ -492,10 +490,19 @@ namespace code {
}
void Metadata::Print(std::ostream& out) {
out << "AMDGPU runtime metadata (" << kernels.size() << " kernels):" << std::endl;
out << "AMDGPU runtime metadata (" << kernels.size() << " kernel";
if (kernels.size() > 1) out << "s";
if (printfInfo.size() > 0) {
out << ", " << printfInfo.size() << " printf info string";
if (printfInfo.size() > 1) out << "s";
}
out << "):" << std::endl;
for (Kernel::Metadata& kernel : kernels) {
kernel.Print(out);
}
for (auto str : printfInfo) {
out << " PrintfInfo \"" << str << "\"" << std::endl;
}
}
}