Answers for "cuda hello_world"

0

cuda hello_world

/*
*hello_world.cu
*/
#include<stdio.h>
__global__ void hello_world(void)
{
  printf("GPU: Hello world!n");
}
int main(int argc,char **argv)
{
  printf("CPU: Hello world!n");
  hello_world<<<1,10>>>();
  cudaDeviceReset();//if no this line ,it can not output hello world from gpu
  return 0;
}
Posted by: Guest on January-15-2022

Browse Popular Code Answers by Language