calling a __host__ function("XXX") from a __global__ function is not allowed
2017-01-06 09:17
549 查看
原因一:
This is happening because of a template argument mismatch. You are calling
a floating point argument and an integer argument. There is only a device template argument for a pair of single precision or double precision floating point arguments .
What you are probably looking for is
原因二:
遇到了这样的错误:
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("cuComplex::operator *") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("cuComplex::operator +") is not
allowed
显然应该是同一个问题 ,有如下解决方案
在定义结构体cuComplex的时候,cuComplex(float a, float b) : r(a), i(b) {}前面要加上__device__
通过也就是说,初始化结构体也要放在device中才能被kernel函数调用
原因三:
经过查找后,发现问题出在VS2010默认的设置和本机不符。这个错误之前也处理过,现在把解决办法搬过来就好。
发现问题出在默认的设置里,计算能力是1.0,SM也是1.0,而这与本机的配置是不匹配的,修改方法只需:
右键解决方案属性-》配置属性-》CUDA C/C++-》Device-》Code Generation,加入compute_20,sm_20,并且把下面的“从父级或项目属性默认设置继承”的勾选去掉,如下图所示。
PS.这里的compute_20,sm_20是根据你自己机器显卡的计算能力来决定的,比如你的是2.0那就相应改成2.0,3.0,3.5依次类推。
error : calling a __host__ function("fmod<float, int> ") from a __global__ function
This is happening because of a template argument mismatch. You are calling
fmodwith
a floating point argument and an integer argument. There is only a device template argument for a pair of single precision or double precision floating point arguments .
What you are probably looking for is
fmod(float, (float)int)....
原因二:
遇到了这样的错误:
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("cuComplex::operator *") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("cuComplex::operator +") is not
allowed
显然应该是同一个问题 ,有如下解决方案
在定义结构体cuComplex的时候,cuComplex(float a, float b) : r(a), i(b) {}前面要加上__device__
通过也就是说,初始化结构体也要放在device中才能被kernel函数调用
原因三:
经过查找后,发现问题出在VS2010默认的设置和本机不符。这个错误之前也处理过,现在把解决办法搬过来就好。
发现问题出在默认的设置里,计算能力是1.0,SM也是1.0,而这与本机的配置是不匹配的,修改方法只需:
右键解决方案属性-》配置属性-》CUDA C/C++-》Device-》Code Generation,加入compute_20,sm_20,并且把下面的“从父级或项目属性默认设置继承”的勾选去掉,如下图所示。
PS.这里的compute_20,sm_20是根据你自己机器显卡的计算能力来决定的,比如你的是2.0那就相应改成2.0,3.0,3.5依次类推。
相关文章推荐
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- MySQL:message from server: "Host xxx is not allowed to connect to this MySQL server"
- message from server: "Host 'xxx' is not allowed to co
- mysql message from server: "Host 'xxx' is not allowed to connect to this MySQL server的解决
- message from server: "Host xxx is not allowed to connect to this MySQL server的解決
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- message from server: "Host 'xxx' is not allowed to connect to this MySQL server"
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQ
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- message from server: "Host 'xxx' is not allowed to connect to this MySQL server的解决
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host '192.168.1.101' is not allowed to connect
- message from server: "Host 'XXXX' is not allowed to connect to this MySQL server"
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- "Host 'xxx' is not allowed to connect to this MySQL server":
- mysql数据库 message from server: "Host is not allowed to connect to this MySQL server"解决办法
- 大牛初步之kettle连接mysql的奇葩错误: message from server: "Host 'PCXX‘ is not allowed to connect to this MySQL s