HSAFoundation / CLOC

CL Offline Compiler : Compile OpenCL kernels to HSAIL
Other
49 stars 18 forks source link

Using CLOC to compile OpenCL kernels to ROCm platform with Fiji GPU #21

Open rjfnobre opened 7 years ago

rjfnobre commented 7 years ago

Is is possible to use CLOC to compile OpenCL kernels that can be used with either a ROCm platform (with NVIDIA Fiji GPU) or with the older AMD Catalyst drivers on Linux?

Before knowing about CLOC, I was thinking to to compile OpenCL kernels with Clang/LLVM and the libclc (http://libclc.llvm.org/) library. But I kind of gave up on that idea after multiple trials, as I could not find a way to use the GCN assembly generated from the Clang/LLVM AMD GCN code generator to assemble a binary that could be loaded by the OpenCL function clCreateProgramWithBinary.

Thanks in advance!

gstoner commented 7 years ago

In 2 day you can just program in OpenCL with ROCm 1.4

Greg On Dec 14, 2016, at 10:33 AM, rjfnobre notifications@github.com<mailto:notifications@github.com> wrote:

Is is possible to use CLOC to compile OpenCL kernels that can be used with either a ROCm platform (with NVIDIA Fiji GPU) or with the older AMD Catalyst drivers on Linux?

Before knowing about CLOC, I was thinking to to compile OpenCL kernels with Clang/LLVM and the libclc (http://libclc.llvm.org/) library. But I kind of gave up on that idea after multiple trials, as I could not find a way to use the GCN assembly generated from the Clang/LLVM AMD GCN code generator to assemble a binary that could be loaded by the OpenCL function clCreateProgramWithBinary.

Thanks in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/HSAFoundation/CLOC/issues/21, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD8Dua0OYtDxFqkCtTZW3i4T1eTSHQVHks5rIBpcgaJpZM4LNIeS.

rjfnobre commented 7 years ago

Thats very good!

And what about using the GCN assembly generated from OpenCL kernels with ROCm?

I'm applying specialized optimization strategies to LLVM IR representing OpenCL kernels, and I would like to use the output of those transformations with ROCm (so that I can generate the binaries that will execute on the GPU).

Do you have an idea on how to do this?

gstoner commented 7 years ago

We will support the same compiler backend we use in HCC AMDGPU compiler, so we will have support for Assembly support. This will be complete CLANG/LLVM code path that emits GCN ISA binary.

On Dec 15, 2016, at 9:27 AM, rjfnobre notifications@github.com<mailto:notifications@github.com> wrote:

Thats very good!

And what about using the GCN assembly generated from OpenCL kernels with ROCm?

I'm applying specialized optimization strategies to LLVM IR representing OpenCL kernels, and I would like to use the output of those transformations with ROCm (so that I can generate the binaries that will execute on the GPU).

Do you have an idea on how to do this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/HSAFoundation/CLOC/issues/21#issuecomment-267355467, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD8DuZfsT1saqIGjBU1MRjR2hawNN8saks5rIVxlgaJpZM4LNIeS.

rjfnobre commented 7 years ago

Because I'm correctly doing experiments in the context of university research using LLVM and I would like to have AMD GPUs represented in the paper, other than only NVIDIA GPUs.

rjfnobre commented 7 years ago

Can you take a look at this? https://github.com/RadeonOpenCompute/ROCm/issues/61

Thanks for your time.