<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 5, 2016, at 09:46, Liu Xin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I never worked on OpenCL+HSA. I just wonder if libclc supports HSA.</div></div></blockquote><div><br class=""></div><div>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.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">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.</div></div></blockquote><br class=""></div>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: <div class=""><a href="https://bitbucket.org/multicoreware/hcc/src/33432be0ab37668e55f1f534294d7525587518a4/lib/hsail-amdgpu-wrapper.ll?at=master&fileviewer=file-view-default" class="">https://bitbucket.org/multicoreware/hcc/src/33432be0ab37668e55f1f534294d7525587518a4/lib/hsail-amdgpu-wrapper.ll?at=master&fileviewer=file-view-default</a></div><div class=""><br class=""></div><div class="">-Matt</div></body></html>