error: asm operand type size(1) does not match type/size implied by constraint 'r'. On Duane Merrill's GPU radix sort

安稳与你 提交于 2019-12-20 07:22:40

问题


I have an error when I am trying to compile Merrill's radix sort under win-XP + VS2005.

error: asm operand type size(1) does not match type/size implied by constraint 'r'.

it occurs in the following code

#define B40C_DEFINE_GLOBAL_LOAD(base_type, dest_type, short_type, ptx_type, reg_mod)\
asm("ld.global.cg."#ptx_type" %0, [%1];" : "="#reg_mod(dest) : _B40C_ASM_PTR_(d_ptr + offset));\
...
B40C_DEFINE_GLOBAL_LOAD(char, signed char, char, s8, r)

Thanks


回答1:


This would appear to be caused by attempting to compile CUDA kernel code containing inline assembly instructions writing specifically for a 64 bit host platform on a 32 bit platform.

The CUDA toolchain ensures that sizeof(void *) is consistent on both host and device by emitting GPU code which matches the address mode of the host CPU. This particular code is assuming that pointers are 64 bit, whereas the code is being compiled in 32 bit host mode, leading to a size mismatch.



来源:https://stackoverflow.com/questions/7073711/error-asm-operand-type-size1-does-not-match-type-size-implied-by-constraint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!