即使我有一张费米卡(gtx 560),我在VS2010上收到此错误:
error : calling a host function("printf") from a __device__/__global__ function("kernel") is not allowed
Run Code Online (Sandbox Code Playgroud)
码:
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
__global__ void kernel()
{
printf("hello");
}
int main()
{
kernel<<<1, 1>>>();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么吗?
cuda ×1