[lldb-dev] [llvm-dev] OpenCL toolset (for AMD GPU)

Leslie Zhai via lldb-dev lldb-dev at lists.llvm.org
Mon Jun 26 01:20:03 PDT 2017


Hi Tom,

Thanks for your kind response!

 > clang -include /path/to/libclc/headers/clc.h -I 
/path/to/libclc/headers -Dcl_clang_storage_class_specifiers -target 
amdgcn--amdhsa -mcpu=carrizo $INPUT_FILE -o $OUTPUT_FILE

When I tried to build cos.cl testcase 
https://github.com/llvm-mirror/libclc/blob/master/test/cos.cl

$ clang -include clc/clc.h -Dcl_clang_storage_class_specifiers -target 
amdgcn--amdhsa -mcpu=carrizo cos.cl -o cos.out

cos.cl:1:27: error: pointer arguments to kernel functions must reside in 
'__global', '__constant' or
       '__local' address space
__kernel void foo(float4 *f) {
                           ^
1 error generated.

Then I added __local before float4 *f like this:

Index: cos.cl
===================================================================
--- cos.cl      (revision 306265)
+++ cos.cl      (working copy)
@@ -1,3 +1,3 @@
-__kernel void foo(float4 *f) {
+__kernel void foo(__local float4 *f) {
    *f = cos(*f);
  }

because [OpenCL] Improve address space diagnostics 
https://reviews.llvm.org/D27671

then rebuilt again,

cos.cl:1:15: error: unsupported call to function _Z3cosDv4_f
__kernel void foo(__local float4 *f) {
               ^
1 error generated.

why not found *cos* function? please give me some hint, thanks a lot!

-- 
Regards,
Leslie Zhai https://reviews.llvm.org/p/xiangzhai/





More information about the lldb-dev mailing list