How to run a cuda program

cuda file:

#include <stdio.h>
__global__ void hello_from_gpu()
{
   printf("Hello World from the the GPU\n");
}
int main(void)
{
  hello_from_gpu<<<4, 4>>>();
  cudaDeviceSynchronize();
  return 0;
}

compile:
nvcc test.cu -o test

run:
image

本文作者:DogeZc

本文链接:https://www.cnblogs.com/zhangcheng1234/p/18212458

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   PostMan_Zc  阅读(10)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起