CUDA示例学习:HelloCUDA

版权声明:本文为博主原创文章,转载请一定附上博主原文链接,并署名转自ZeroZone零域。 https://blog.csdn.net/ksws0292756/article/details/82744960
//hellocuda.cu
#include <iostream>
#include "stdio.h"

__global__ void kernel(void){
    printf("hello, cvudakernel\n");

}

int main(void){
    kernel<<<1,5>>>();
    cudaDeviceReset();
    return 0 ;
}

在命令行执行

$nvcc hellocuda.cu -o hellocuda
$./hellocuda

输出结果:

hello, cvudakernel
hello, cvudakernel
hello, cvudakernel
hello, cvudakernel
hello, cvudakernel

猜你喜欢

转载自blog.csdn.net/ksws0292756/article/details/82744960
今日推荐