是否有可能把汇编指令到CUDA code? [英] Is it possible to put assembly instructions into CUDA code?

查看:368
本文介绍了是否有可能把汇编指令到CUDA code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用汇编code在CUDA C code
为了减少昂贵处决
因为我们使用的 ASM 在C语言编程。

I want to use assembly code in CUDA C code in order to reduce expensive executions as we do using asm in c programming.

这可能吗?

推荐答案

没有,你不能,有没有像在C / C ++的ASM结构。你可以做的是调整生成的PTX组装,然后用CUDA使用它。

No, you can't, there is nothing like the asm constructs from C/C++. What you can do is tweak the generated PTX assembly and then use it with CUDA.

请参阅一个例子。

但对于GPU的,装配优化是没有必要的,你应该做其他优化第一,如内存coalescency和占用情况。请参阅<一个href=\"http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Best_Practices_Guide.pdf\"相对=nofollow> CUDA最佳实践指南以获取更多信息。

But for GPUs, assembly optimizations are NOT necessary, you should do other optimizations first, such as memory coalescency and occupancy. See the CUDA Best Practices guide for more information.

这篇关于是否有可能把汇编指令到CUDA code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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