calling a host function from a __device__/__global__ function is not allowed
来源:互联网 发布:中国最美的地方 知乎 编辑:程序博客网 时间:2024/05/17 04:44
昨天开始实现《GPU高性能编程CUDA实战》上面的例子,碰到了生成julia集,很兴奋,赶紧实现。
基于CPU的,用到"cpu_bitmap.h"这个头文件,我电脑上没有,不过直接从网上找了一个,添加到我的工程中就行
"cpu_bitmap.h"中又用到"gl_helper.h"这个头文件,我觉得没啥用,直接注释掉了
不过因为"cpu_bitmap.h"中用到了glut的函数和exit(),需要自己手动添加头文件<gl\glut.h>
或者直接去网上把"gl_helper.h"找到,添加进工程,此时编译仍出错,添加<stdlib.h>即可
基于GPU除了那些问题之外,遇到了这样的错误:
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 notallowed
calling a host function("cuComplex::cuComplex") from a__device__/__global__ function("cuComplex::operator +") is notallowed
显然应该是同一个问题
google一下,官网有解决方案
在定义结构体cuComplex的时候,cuComplex(float a, float b) : r(a), i(b){}前面要加上__device__
通过
也就是说,初始化结构体也要放在device中才能被kernel函数调用显然应该是同一个问题
google一下,官网有解决方案
在定义结构体cuComplex的时候,cuComplex(float a, float b) : r(a), i(b){}前面要加上__device__
通过
改变阈值很有意思啊
原文来自:http://blog.sina.com.cn/s/blog_772645ff0100wl0n.html
- calling a host function from a __device__/__global__ function is not allowed
- calling a __host__ function("_wassert") from a __global__ function is not allowed错误
- calling a __host__ function("XXX") from a __global__ function is not allowed
- TypeError: $ is not a function when calling jQuery function
- $ is not a function
- $ is not a function
- is not a function
- error: a function-definition is not allowed here before ‘{’ token
- Dynamically Calling a Function
- $(...).niceScroll is not a function; $... is not a function
- object is not a function
- RVM is not a function
- $(...).scrollpic is not a function
- javascript *** is not a function
- $(...).live is not a function
- $(...).niceScroll is not a function
- $(...).live is not a function
- $(...).modal is not a function
- 在路上
- __attribute__()__attribute__ ((attribute-list))(转)
- O2O式生活
- Oracle与MySQL的几点区别
- ARX常用函数
- calling a host function from a __device__/__global__ function is not allowed
- 用一个表的记录更新另外一个表.
- poj 1920 Towers of Hanoi
- CS下在C#里调用显示水晶报表
- Flex DataGrid开发常用属性和技巧
- Junit4实例图解[收藏]
- oo软件设计说明书结构
- Oracle sql 性能优化调整 .
- 进程号和线程号