[Beignet] [PATCH 7/7] backend: Turn on ASM dump.

Laura Ekstrand laura.d.ekstrand at intel.com
Mon Jul 27 10:25:17 PDT 2015


Open the file specified for the ASM dump and write the assembly to it.
---
 backend/src/backend/gen_context.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index 446b693..56946a3 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -2295,6 +2295,14 @@ namespace gbe
     if (OCL_OUTPUT_ASM)
       outputAssembly(stdout, genKernel);
 
+    if (this->asmFileName) {
+      FILE *asmDumpStream = fopen(this->asmFileName, "w");
+      if (asmDumpStream) {
+        outputAssembly(asmDumpStream, genKernel);
+        fclose(asmDumpStream);
+      }
+    }
+
     return true;
   }
 
-- 
2.1.0



More information about the Beignet mailing list