From 9e9f65bf9501795dcd21b79907435344d9efc5d3 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 2 Dec 2016 06:41:36 -0500
Subject: [PATCH] P4 to Git Change 1348779 by
nhaustov@spb-hlc-fiji1_opencl_rocm on 2016/12/02 06:23:08
SWDEV-102966 - Dump code object disassembly in OpenCL rocm device.
Invoke DumpExecutableAsText from driver library.
Update build to depend on some more LLVM libraries.
LLVM changes are included, but will come through amd-common.
Driver changes will come through ROCm-OpenCL-driver.
Testing: Run some SDK samples/test_basic with AMD_OCL_BUILD_OPTIONS_APPEND=-save-temps
Reviewed by: Laurent Morichetti, German Andryeyev.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#47 edit
[ROCm/clr commit: c7d2b188de349f506e9382c0b6920d570c2ddefa]
---
projects/clr/rocclr/runtime/device/pal/palprogram.cpp | 8 ++++++++
projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/projects/clr/rocclr/runtime/device/pal/palprogram.cpp b/projects/clr/rocclr/runtime/device/pal/palprogram.cpp
index 19f4fc38c4..57f022b0f4 100644
--- a/projects/clr/rocclr/runtime/device/pal/palprogram.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palprogram.cpp
@@ -1523,6 +1523,14 @@ LightningProgram::linkImpl(amd::option::Options *options)
}
}
+ if (options->isDumpFlagSet(amd::option::DUMP_ISA)) {
+ std::string name = options->getDumpFileName(".s");
+ File *dump = C->NewFile(DT_INTERNAL, name);
+ if (!C->DumpExecutableAsText(out_exec, dump)) {
+ buildLog_ += "Warning: failed to dump code object.\n";
+ }
+ }
+
return setKernels(options, out_exec->Buf().data(), out_exec->Size());
}
diff --git a/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp b/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp
index c9cc6dc4eb..bf66c20e82 100644
--- a/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp
@@ -827,6 +827,14 @@ HSAILProgram::linkImpl_LC(amd::option::Options *options)
}
}
+ if (options->isDumpFlagSet(amd::option::DUMP_ISA)) {
+ std::string name = options->getDumpFileName(".s");
+ File *dump = C->NewFile(DT_INTERNAL, name);
+ if (!C->DumpExecutableAsText(out_exec, dump)) {
+ buildLog_ += "Warning: failed to dump code object.\n";
+ }
+ }
+
return setKernels_LC( options, out_exec->Buf().data(), out_exec->Size() );
}