mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2024-11-24 15:19:15 +08:00
update sample cudaNvSci
This commit is contained in:
parent
bf8c6dd043
commit
9d4c014f60
|
@ -113,7 +113,12 @@ class cudaNvSciSignal {
|
|||
"%d.%d\n\n",
|
||||
m_cudaDeviceId, _ConvertSMVer2ArchName(major, minor), major, minor);
|
||||
|
||||
#ifdef cuDeviceGetUuid_v2
|
||||
CUresult res = cuDeviceGetUuid_v2(&m_devUUID, m_cudaDeviceId);
|
||||
#else
|
||||
CUresult res = cuDeviceGetUuid(&m_devUUID, m_cudaDeviceId);
|
||||
#endif
|
||||
|
||||
if (res != CUDA_SUCCESS) {
|
||||
fprintf(stderr, "Driver API error = %04d \n", res);
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -387,7 +392,11 @@ class cudaNvSciWait {
|
|||
checkCudaErrors(cudaSetDevice(m_cudaDeviceId));
|
||||
checkCudaErrors(
|
||||
cudaStreamCreateWithFlags(&streamToRun, cudaStreamNonBlocking));
|
||||
#ifdef cuDeviceGetUuid_v2
|
||||
CUresult res = cuDeviceGetUuid_v2(&m_devUUID, m_cudaDeviceId);
|
||||
#else
|
||||
CUresult res = cuDeviceGetUuid(&m_devUUID, m_cudaDeviceId);
|
||||
#endif
|
||||
if (res != CUDA_SUCCESS) {
|
||||
fprintf(stderr, "Driver API error = %04d \n", res);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
@ -93,7 +93,7 @@ void launchGrayScaleKernel(unsigned int *d_rgbaImage,
|
|||
d_rgbaImage, imageWidth, imageHeight);
|
||||
|
||||
unsigned int *outputData;
|
||||
checkCudaErrors(cudaMallocHost(&outputData, sizeof(unsigned int) * imageWidth * imageHeight));
|
||||
checkCudaErrors(cudaMallocHost((void**)&outputData, sizeof(unsigned int) * imageWidth * imageHeight));
|
||||
checkCudaErrors(cudaMemcpyAsync(
|
||||
outputData, d_rgbaImage, sizeof(unsigned int) * imageWidth * imageHeight,
|
||||
cudaMemcpyDeviceToHost, stream));
|
||||
|
|
Loading…
Reference in New Issue
Block a user