错误:asm操作数类型size(1)与约束'r'隐含的类型/大小不匹配.关于Duane Merrill的GPU基数排序 [英] error: asm operand type size(1) does not match type/size implied by constraint 'r'. On Duane Merrill's GPU radix sort

查看:156
本文介绍了错误:asm操作数类型size(1)与约束'r'隐含的类型/大小不匹配.关于Duane Merrill的GPU基数排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在win-XP + VS2005下编译Merrill的基数排序时出现错误.

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

错误:asm操作数类型size(1)与约束'r'隐含的类型/大小不匹配.

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

它在以下代码中发生

#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)

谢谢

推荐答案

这似乎是由于尝试编译包含专门为32位平台上的64位主机平台编写的内联汇编指令的CUDA内核代码引起的.

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.

CUDA工具链通过发出与主机CPU地址模式匹配的GPU代码,确保 sizeof(void *)在主机和设备上均一致.该特定代码假定指针是64位的,而该代码是在32位主机模式下编译的,从而导致大小不匹配.

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.

这篇关于错误:asm操作数类型size(1)与约束'r'隐含的类型/大小不匹配.关于Duane Merrill的GPU基数排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆