第一个cuda代码

这是第一个cuda代码的实现。

 #include <iostream>
 #include <cuda_runtime.h>
 #include <stdio.h>
 __global__ void print()
 {
     //std::cout << "hello GPU!!"<< std::endl;
     printf("hello GPU!!\n");
 }
 
 int main()
 {
     std::cout << "This is GPU print!!"<< std::endl;
     print<<<1,10>>>();
     cudaDeviceReset();
     return 0;
 }

猜你喜欢

转载自blog.csdn.net/m0_38036750/article/details/83479024
今日推荐