CUDA:'name'在目标位置没有值 [英] CUDA: 'name' has no value at the target location

查看:155
本文介绍了CUDA:'name'在目标位置没有值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的代码当我调用findMax函数,索引变量不能定义,但max,我可以定义和工作。我试着用不同的名字,但不工作。什么是问题?

in my code when i call findMax function, index variable can't defined but max,i can defined and work. i so try with different names but not works. what is problem?

推荐答案

即使禁用所有优化,CUDA编译器也会执行一些优化。 index 在设备函数findMax中没有副作用,因此编译器删除了该变量。

The CUDA compiler performs some optimizations even when you disable all optimizations. index has no side effect in the device function findMax so the compiler eliminated the variable.

这篇关于CUDA:'name'在目标位置没有值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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