最近我开始学习CUDA。这是我从内核打印的简单代码。无法理解简单CUDA函数中的错误
#include"cuPrintf.cu"
#include"cuPrintf.cuh"
#include<cuda.h>
#include<stdio.h>
__global__ void cuprint()
{
cuPrintf("He he, I am printing from here");
}
main()
{
cuprint<<<1,1>>>cuprint();
}
cuPrintf.cu
和cuPrintf.cuh
下载并保存在我写这个程序的目录。我收到以下错误。
cuprint.cu(11): error: expected a "("
cuprint.cu(13): error: expected a declaration
任何人都可以告诉我为什么我得到这些错误。
这消除了我的错误。但cuPrintf不在我的屏幕上打印任何东西 – Pawan 2014-09-19 10:04:49
您正在使用哪种CUDA版本? – 2014-09-19 10:06:13
我正在使用cuda 6 – Pawan 2014-09-19 10:06:47