Skip to content

Commit a78fba9

Browse files
committed
update sample cudaNvSci
1 parent 876266c commit a78fba9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Samples/cudaNvSci/cudaNvSci.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ class cudaNvSciSignal {
113113
"%d.%d\n\n",
114114
m_cudaDeviceId, _ConvertSMVer2ArchName(major, minor), major, minor);
115115

116+
#ifdef cuDeviceGetUuid_v2
117+
CUresult res = cuDeviceGetUuid_v2(&m_devUUID, m_cudaDeviceId);
118+
#else
116119
CUresult res = cuDeviceGetUuid(&m_devUUID, m_cudaDeviceId);
120+
#endif
121+
117122
if (res != CUDA_SUCCESS) {
118123
fprintf(stderr, "Driver API error = %04d \n", res);
119124
exit(EXIT_FAILURE);
@@ -387,7 +392,11 @@ class cudaNvSciWait {
387392
checkCudaErrors(cudaSetDevice(m_cudaDeviceId));
388393
checkCudaErrors(
389394
cudaStreamCreateWithFlags(&streamToRun, cudaStreamNonBlocking));
395+
#ifdef cuDeviceGetUuid_v2
396+
CUresult res = cuDeviceGetUuid_v2(&m_devUUID, m_cudaDeviceId);
397+
#else
390398
CUresult res = cuDeviceGetUuid(&m_devUUID, m_cudaDeviceId);
399+
#endif
391400
if (res != CUDA_SUCCESS) {
392401
fprintf(stderr, "Driver API error = %04d \n", res);
393402
exit(EXIT_FAILURE);

Samples/cudaNvSci/imageKernels.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void launchGrayScaleKernel(unsigned int *d_rgbaImage,
9393
d_rgbaImage, imageWidth, imageHeight);
9494

9595
unsigned int *outputData;
96-
checkCudaErrors(cudaMallocHost(&outputData, sizeof(unsigned int) * imageWidth * imageHeight));
96+
checkCudaErrors(cudaMallocHost((void**)&outputData, sizeof(unsigned int) * imageWidth * imageHeight));
9797
checkCudaErrors(cudaMemcpyAsync(
9898
outputData, d_rgbaImage, sizeof(unsigned int) * imageWidth * imageHeight,
9999
cudaMemcpyDeviceToHost, stream));

0 commit comments

Comments
 (0)