[Mesa-dev,6/8] clover/llvm: Pass device down to compile

Submitted by Aaron Watry on July 31, 2017, 1:26 a.m.

Details

Message ID 20170731012612.23176-7-awatry@gmail.com
State New
Headers show
Series "A few clover fixes for both CTS and eventual 1.2 support" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Aaron Watry July 31, 2017, 1:26 a.m.
We'll need to be able to detect device version to define the appropriate
__OPENCL_VERSION__ header.

Signed-off-by: Aaron Watry <awatry@gmail.com>
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index e761ca188d..16966bedb3 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -203,7 +203,7 @@  namespace {
    std::unique_ptr<Module>
    compile(LLVMContext &ctx, clang::CompilerInstance &c,
            const std::string &name, const std::string &source,
-           const header_map &headers, const std::string &target,
+           const header_map &headers, const device &dev,
            const std::string &opts, std::string &r_log) {
       c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
       c.getHeaderSearchOpts().UseBuiltinIncludes = true;
@@ -247,7 +247,7 @@  namespace {
       // barrier() (e.g. Moving barrier() inside a conditional that is
       // no executed by all threads) during its optimizaton passes.
       compat::add_link_bitcode_file(c.getCodeGenOpts(),
-                                    LIBCLC_LIBEXECDIR + target + ".bc");
+                                    LIBCLC_LIBEXECDIR + dev.ir_target() + ".bc");
 
       // Compile the code
       clang::EmitLLVMOnlyAction act(&ctx);
@@ -270,7 +270,7 @@  clover::llvm::compile_program(const std::string &source,
    auto ctx = create_context(r_log);
    auto c = create_compiler_instance(dev.ir_target(), tokenize(opts + " input.cl"),
                                      dev.device_clc_version(), r_log);
-   auto mod = compile(*ctx, *c, "input.cl", source, headers, dev.ir_target(), opts,
+   auto mod = compile(*ctx, *c, "input.cl", source, headers, dev, opts,
                       r_log);
 
    if (has_flag(debug::llvm))