[Beignet] [PATCH 4/7] backend, src: Add ASM file name to gbe_program_new_from_llvm

Manasi Navare manasi.d.navare at intel.com
Tue Aug 11 22:54:17 PDT 2015


From: Laura Ekstrand <laura.d.ekstrand at intel.com>

Part of the plumbing that passes the ASM file name from the compiler options
level down to the emitCode level so that the assembly can be written to that
file

Signed-off-by: Manasi Navare <manasi.d.navare at intel.com>
Signed-off-by: Laura Ekstrand <laura.d.ekstrand at intel.com>
---
 backend/src/backend/gen_program.cpp | 1 +
 backend/src/backend/program.cpp     | 2 +-
 backend/src/backend/program.h       | 1 +
 src/cl_program.c                    | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
index c761a2f..767db29 100644
--- a/backend/src/backend/gen_program.cpp
+++ b/backend/src/backend/gen_program.cpp
@@ -352,6 +352,7 @@ namespace gbe {
                                            const char *fileName,
                                            const void* module,
                                            const void* llvm_ctx,
+                                           const char* asm_file_name,
                                            size_t stringSize,
                                            char *err,
                                            size_t *errSize,
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index 404a668..6f64413 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -840,7 +840,7 @@ namespace gbe {
       }
       #endif
 
-      p = gbe_program_new_from_llvm(deviceID, NULL, out_module, llvm_ctx, stringSize,
+      p = gbe_program_new_from_llvm(deviceID, NULL, out_module, llvm_ctx, dumpASMFileName.c_str(), stringSize,
                                     err, errSize, optLevel);
       if (err != NULL)
         *errSize += clangErrSize;
diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h
index 3637ebb..3267714 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -212,6 +212,7 @@ typedef gbe_program (gbe_program_new_from_llvm_cb)(uint32_t deviceID,
                                                    const char *fileName,
                                                    const void *module,
                                                    const void *llvm_ctx,
+                                                   const char *asm_file_name,
                                                    size_t string_size,
                                                    char *err,
                                                    size_t *err_size,
diff --git a/src/cl_program.c b/src/cl_program.c
index db53757..423cb5c 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -379,7 +379,7 @@ cl_program_create_from_llvm(cl_context ctx,
   INVALID_VALUE_IF (file_name == NULL);
 
   program = cl_program_new(ctx);
-  program->opaque = compiler_program_new_from_llvm(ctx->device->vendor_id, file_name, NULL, NULL, program->build_log_max_sz, program->build_log, &program->build_log_sz, 1);
+  program->opaque = compiler_program_new_from_llvm(ctx->device->vendor_id, file_name, NULL, NULL, NULL, program->build_log_max_sz, program->build_log, &program->build_log_sz, 1);
   if (UNLIKELY(program->opaque == NULL)) {
     err = CL_INVALID_PROGRAM;
     goto error;
-- 
1.9.1



More information about the Beignet mailing list