HSAFoundation / CLOC

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

CLOC 1.0.x addrspacecast not implemented #16

Open PXAHyLee opened 8 years ago

PXAHyLee commented 8 years ago

Hi developers,

When using cloc 0.9 (which is based on llvm 3.2), one of the example, in AMD APP SDK, MonteCarloAsianDP_Kernels.cl can work.

However, when the new LLVM toolchain uses the addrspacecast to generate the kernel code, CLOC emits the error message like error: addrspacecast not implemented.

For now, I can still use cloc -hsail MonteCarloAsianDP_Kernels.cl to use the old version (hlc3.2) of LLVM toolchain to run my application. This issue can also be found in the current LLVM trunk.

So, how to work around this kind of problem when using new CLOC toolchain now? There are some benchmarks that fail to compile. [EDIT: I think a viable solution may be trying to not use generic address space in this case.]

Thanks.

The aforementioned example is in the attachment. Kernel code LLVM Assembly code

gregrodgers commented 8 years ago

You are doing the right thing to switch back to cloc.sh -hsail or -brig on this test case. Also, if you are using snack.sh, you need to switch to snackhsail.sh. The hsa code object path still has some roughness including some address spaces not implemented. When I have a new LLVM 3.9 code generator for amdgcn that supports this, I will create a new set of amdllvm packages and then update this issue.