cuda编程学习1——hello world!

将c程序最简单的hello world用cuda编写在GPU上执行,以下为代码:

#include<iostream>
using namespace std;
__global__ void kernel(void)//__global__:cpu调用GPU执行
{}
int main(void)
{
kernel<<<1,1>>>();//启动1block 1thread
cout<<"hello world!"<<endl;
return 0;
}

原文地址:https://www.cnblogs.com/shrimp-can/p/5031098.html