Re: [Mesa-dev] [PATCH 3/5] clover/llvm: Pass device down to compile

2018-03-01 Thread Francisco Jerez
Aaron Watry  writes:

> We'll need to be able to detect device version to define the appropriate
> __OPENCL_VERSION__ header.
>
> v2: Rebase after removing the previous patch (Pierre)
>   - Removed "clover: Add device_clc_version to llvm::create_compiler_instance"
>
> Signed-off-by: Aaron Watry 
> Cc: Pierre Moreau 

Patches 1-3 are:

Reviewed-by: Francisco Jerez 

> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
> b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 42aabfb9a3..1924c0317f 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -146,7 +146,7 @@ namespace {
> std::unique_ptr
> compile(LLVMContext , clang::CompilerInstance ,
> const std::string , const std::string ,
> -   const header_map , const std::string ,
> +   const header_map , const device ,
> const std::string , std::string _log) {
>c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
>c.getHeaderSearchOpts().UseBuiltinIncludes = true;
> @@ -190,7 +190,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();
> @@ -212,8 +212,7 @@ clover::llvm::compile_program(const std::string ,
>  
> auto ctx = create_context(r_log);
> auto c = create_compiler_instance(dev, tokenize(opts + " input.cl"), 
> r_log);
> -   auto mod = compile(*ctx, *c, "input.cl", source, headers, dev.ir_target(),
> -  opts, r_log);
> +   auto mod = compile(*ctx, *c, "input.cl", source, headers, dev, opts, 
> r_log);
>  
> if (has_flag(debug::llvm))
>debug::log(".ll", print_module_bitcode(*mod));
> -- 
> 2.14.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/5] clover/llvm: Pass device down to compile

2018-03-01 Thread Aaron Watry
We'll need to be able to detect device version to define the appropriate
__OPENCL_VERSION__ header.

v2: Rebase after removing the previous patch (Pierre)
  - Removed "clover: Add device_clc_version to llvm::create_compiler_instance"

Signed-off-by: Aaron Watry 
Cc: Pierre Moreau 
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 42aabfb9a3..1924c0317f 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -146,7 +146,7 @@ namespace {
std::unique_ptr
compile(LLVMContext , clang::CompilerInstance ,
const std::string , const std::string ,
-   const header_map , const std::string ,
+   const header_map , const device ,
const std::string , std::string _log) {
   c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
   c.getHeaderSearchOpts().UseBuiltinIncludes = true;
@@ -190,7 +190,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();
@@ -212,8 +212,7 @@ clover::llvm::compile_program(const std::string ,
 
auto ctx = create_context(r_log);
auto c = create_compiler_instance(dev, tokenize(opts + " input.cl"), r_log);
-   auto mod = compile(*ctx, *c, "input.cl", source, headers, dev.ir_target(),
-  opts, r_log);
+   auto mod = compile(*ctx, *c, "input.cl", source, headers, dev, opts, r_log);
 
if (has_flag(debug::llvm))
   debug::log(".ll", print_module_bitcode(*mod));
-- 
2.14.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev