[cfe-dev] OpenCL: get_global_linear_id() not supported?

Frank Winter via cfe-dev cfe-dev at lists.llvm.org
Sun May 9 11:11:51 PDT 2021


The follwing kernel doesn't compile with Clang (current upstream):

__kernel void test()
{
  int i = get_global_linear_id();
}

clang  -emit-llvm -target amdgcn-amd-amdhsa -mcpu=gfx908 -Xclang -finclude-default-header -c test.cl -o test_amd.bc

test.cl:3:11: error: implicit declaration of function 'get_global_linear_id' is invalid in OpenCL
  int i = get_global_linear_id();
          ^
1 error generated.

Per Khronos OpenCL 2.0 specification this function is part of the standard.

What am I missing here?

Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210509/35d97757/attachment-0001.html>


More information about the cfe-dev mailing list