如何编译cuda内核没有优化? [英] how to compile cuda kernel without optimizing at all?
本文介绍了如何编译cuda内核没有优化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我编译这个
__global__ void dummy_kernel(float *a, int N, float* b, int N2){
unsigned int i = blockIdx.y*blockDim.y + threadIdx.y;
unsigned int j = blockIdx.x*blockDim.x + threadIdx.x;
}
我得到这个空的ptx代码
i get this empty ptx code
.entry _Z9dummy_kernelPfiS_i(
.param .u64 _Z9dummy_kernelPfiS_i_param_0,
.param .u32 _Z9dummy_kernelPfiS_i_param_1,
.param .u64 _Z9dummy_kernelPfiS_i_param_2,
.param .u32 _Z9dummy_kernelPfiS_i_param_3
)
{
ret;
}
有没有办法强制编译器生成ptx而不进行优化?
Is there a way to force the compiler to generate ptx without optimizing at all?
推荐答案
尝试-g -G开关
看看它是什么输出
我不确定将覆盖所有可能的优化
Try -g -G switches And see what it puts out I'm not sure that will cover all possible optimizations
这篇关于如何编译cuda内核没有优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文