[llvm-dev] OpenCL toolset (for AMD GPU)
Tom Stellard via llvm-dev
llvm-dev at lists.llvm.org
Tue Sep 29 07:19:04 PDT 2015
On Tue, Sep 29, 2015 at 01:20:57PM +0000, Paweł Bylica via llvm-dev wrote:
> Hi LLVM,
>
> I would like to compile OpenCL kernel for a specific AMD GPU target. Is it
> possible with the current clang/LLVM?
>
> I started by using `clang -x cl` but it looks like at least some OpenCL
> specific headers are missing (e.g. uint2 is not recognized as a type).
>
> Any links to documentation / tutorials very welcome. Thanks.
>
Hi,
You need to include OpenCL library headers from libclc
(http://libclc.llvm.org/) to compile most OpenCL code.
Here is an example command:
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
-Tom
> - Paweł
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
More information about the llvm-dev
mailing list