CUDA并行编程问题(2)
问题:为什么没有cudaDeviceReset();不出结果
cudaDeviceReset();函数:
The function cudaDeviceReset() will explicitly destroy and clean up all resources associated with the current device in the current process.
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
__global__ void HellowfromGPU( void ){
printf("hellow world from :%d\n", threadIdx.x);
if (threadIdx.x == 5){
printf("hellow world from thread 5\n");
}
}
int main(void ){
HellowfromGPU << <1, 10 >> >();
//cudaDeviceReset();
//cudaDeviceSynchronize();
}
有cudaDeviceReset();: