[llvm-dev] [AMDGPU] non-hsa intrinsic with hsa target

Matt Arsenault via llvm-dev llvm-dev at lists.llvm.org
Sat Mar 5 14:28:18 PST 2016


> On Mar 5, 2016, at 09:46, Liu Xin via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I never worked on OpenCL+HSA. I just wonder if libclc supports HSA.

It does not currently, and only supports Clover’s ABI. The reason there are still r600 related intrinsics being used for workitems is mostly because I haven’t gotten around to fixing it. Clover should be reading these from an offset from the kernel argument pointer rather than having special case intrinsics, or it could start putting arguments somewhere else.

> 
> HSA RT uses 'hsa_kernel_dispatch_packet_t' to get know workgroup size and grid size. so far, I didn't see hsa-specific implementation appears in libclc.

The Mesa ABI reads items out of a hidden kernel argument area before the true arguments, while HSA reads from the dispatch packet pointer, which has an intrinsic for it. You can see how these are implemented here: 
https://bitbucket.org/multicoreware/hcc/src/33432be0ab37668e55f1f534294d7525587518a4/lib/hsail-amdgpu-wrapper.ll?at=master&fileviewer=file-view-default <https://bitbucket.org/multicoreware/hcc/src/33432be0ab37668e55f1f534294d7525587518a4/lib/hsail-amdgpu-wrapper.ll?at=master&fileviewer=file-view-default>

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160305/7ce103ea/attachment.html>


More information about the llvm-dev mailing list