解决“两个CU文件冲突”expected an expression
来源:互联网 发布:彩虹六号网络类型open 编辑:程序博客网 时间:2024/05/09 06:06
最近在学习cuda编程,刚刚起步,未免有很多困难,也想把自己的每一步的历程记录下来,将每一个所犯的错误记下来,以便将来不会犯同一个错误。这个程式是做的“GPU-高性能运算之CUDA”一本书的第二个例子,matrixassign,编译出现了如下错误
1>e:/CUDA/Practice/MatrixAssign/MatrixAssign/matrix_assign_kernel.cu(17): error: expected an expression
1>e:/CUDA/Practice/MatrixAssign/MatrixAssign/matrix_assign_kernel.cu(9): warning: variable "bid" was declared but never referenced
1>1 error detected in the compilation of "C:/Users/ADMINI~1/AppData/Local/Temp/tmpxft_000013d0_00000000-6_matrix_assign_kernel.cpp1.ii".
1>Project : error PRJ0019: A tool returned an error code from "Compiling with CUDA Build Rule..."
解决放吧,将main函数所在的cu文件外的其他文件的编译器改成用户自定义的,而包含main的cu文件的编译器用cuda编译器,便可以解决
本来都要准备庆祝了,可是来了一段小插曲,又出现错误,跟上面是一样的,怎么看怎么看不出,我程序中有这么一段话
sdata[tid_in_block] * =(float)bid;注意*和=之间是有空格的,后来在网上搜索,才知道,去掉空格就一切ok了,我真的是狂晕,不过还是值得庆贺的,让我看到这个求助帖。哎,一切还是要认真啊,可是我不明白为什么不能有空格。以后碰到这样的还是不用为好啊
- 解决“两个CU文件冲突”expected an expression
- Keil MDK C (error: #29: expected an expression) 错误的解决
- Keil MDK C (error: #29:expected an expression)错误的解决
- stm32 mdk c++(error: #29: expected an expression)
- stm32 mdk c++(error: #29: expected an expression)
- 宏定义中Error[Pe029]: expected an expression
- Expected ']' Expected expression
- IndentationError:expected an indented block错误解决
- IndentationError:expected an indented block错误解决
- IndentationError:expected an indented block错误解决
- IndentationError:expected an indented block错误解决
- IndentationError:expected an indented block错误解决
- IndentationError:expected an indented block错误解决
- IndentationError:expected an indented block错误解决
- IndentationError:expected an indented block错误解决
- .cu文件
- 『已解决』expected expression before ‘struct’
- C语言标准c89、c99、c++11。问题:expected an expression ,identifier "i" is undefined
- STL容器类vector,list,deque的比较
- VC Log中输出时间的方法
- 《COM技术内幕》阅读笔记第10章
- Ant Chmod命令详解
- mtk有关的不错网站
- 解决“两个CU文件冲突”expected an expression
- resin的ssl配置
- oracle的exp/imp使用方法学习
- 详解Linux设置网络基本参数
- ETL策略概述
- 关于linux内核中 等待队列 数据结构之思考
- 人人都是产品经理
- 卡拉曼滤波
- 数据库中文乱码