ROCm / ROCm-Device-Libs

ROCm Device Libraries
97 stars 60 forks source link

ockl/src/toas.cl does not compile #11

Closed gregrodgers closed 5 years ago

gregrodgers commented 7 years ago

If __private pointer is 64 bits then a typecast from uint chops it. This is how I fixed it.

grodgers@t0:~/git/ROC/rocm-device-libs/ockl/src$ git diff toas.cl diff --git a/ockl/src/toas.cl b/ockl/src/toas.cl index 604b87a..ba9a6c3 100644 --- a/ockl/src/toas.cl +++ b/ockl/src/toas.cl @@ -37,6 +37,6 @@ attribute((always_inline, const)) __private void OCKL_MANGLE_T(to,private)(void a) { uint u = (uint)((ulong)a);

kasaurov commented 7 years ago

I have a feeling that the proposed fix breaks the meaning of the function. Wouldn't the following fix be a more correct (as uintptr_t changes the bittness depending on CL_DEVICE_ADDRESS_BITS)

cqe@spb-hlc-fiji1h:/srv/akasauro/git/ROCm-Device-Libs/ockl/src$ git diff diff --git a/ockl/src/toas.cl b/ockl/src/toas.cl index 604b87a..64444ea 100644 --- a/ockl/src/toas.cl +++ b/ockl/src/toas.cl @@ -36,7 +36,7 @@ OCKL_MANGLE_T(to,local)(void a) attribute((always_inline, const)) __private void OCKL_MANGLE_T(to,private)(void *a) {

b-sumner commented 7 years ago

I really don't understand. A private address space pointer is never 64 bit. The only pointers that might change size is the size of global or generic pointers, but we are not supporting 32 bit for those either.

zjing14 commented 7 years ago

I got the following error with either of above fix (tag rocm-1.5.0).
The LLVM setup: LLVM: https://github.com/RadeonOpenCompute/lld/tree/rocm-1.5.0 LLD: https://github.com/RadeonOpenCompute/lld/tree/rocm-1.5.0 clang: https://github.com/RadeonOpenCompute/hcc-clang-upgrade/tree/rocm-1.5.0

Any thought?

[ 76%] Linking OCL static library ockl.lib.bc Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.queue.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.queue.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.queue.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.queue.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.queue.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.implicitarg.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.implicitarg.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.implicitarg.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.implicitarg.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.implicitarg.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.implicitarg.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr Intrinsic has incorrect return type! i8 addrspace(2) () @llvm.amdgcn.dispatch.ptr /home/zhang/RadeonOpenCompute/llvm_amd-common/build/./bin/llvm-link: error: linked module is broken! ockl/CMakeFiles/ockl_lib.dir/build.make:356: recipe for target 'ockl/ockl.lib.bc' failed make[2]: [ockl/ockl.lib.bc] Error 1 CMakeFiles/Makefile2:913: recipe for target 'ockl/CMakeFiles/ockl_lib.dir/all' failed make[1]: [ockl/CMakeFiles/ockl_lib.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: *** [all] Error 2

b-sumner commented 5 years ago

I'm assuming this old issue can be closed. Please reopen if I'm mistaken.