#include <stdio.h>
__global__ void helloFromGPU(void)
{
//printf("Hello World from GPU thread %d\n", threadIdx.x);
printf("Hello World from GPU thread %d\n", 5);
}
int main(int argc, char* argv[])
{
printf("Hello World from CPU\n");
helloFromGPU<<<1, 1>>>();
cudaDeviceReset();
//cudaDeviceSynchronize();
return 0;
}
显卡是RTX2060,CUDA 10.2,Ubuntu18.04, VS Code Insiders