Skip to content

Commit

Permalink
cuda: print CUDA runtime version in minimal.cu
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Oct 10, 2024
1 parent e3d18a0 commit 3aa75cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gpu/cuda/src/minimal.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ int main() {
cudaError_t err = cudaSuccess;
int count = 0;

int runtimeVersion = 0;

// Get CUDA runtime version
err = cudaRuntimeGetVersion(&runtimeVersion);
if (err != cudaSuccess) {
printf("cudaRuntimeGetVersion failed: %s\n", cudaGetErrorString(err));
return 1;
}

printf("CUDA Runtime version: %d.%d\n", runtimeVersion / 1000, (runtimeVersion % 100) / 10);


err = cudaGetDeviceCount(&count);
if (err != cudaSuccess) {
printf("cudaGetDeviceCount failed: %s\n", cudaGetErrorString(err));
Expand Down

0 comments on commit 3aa75cf

Please sign in to comment.