MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / getDeviceVersion

Function getDeviceVersion

cpp/4_CUDA_Libraries/batchCUBLAS/batchCUBLAS.cpp:62–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60#endif /* __cplusplus */
61
62 int getDeviceVersion(void)
63 {
64 int device;
65 struct cudaDeviceProp properties;
66
67 if (cudaGetDevice(&device) != cudaSuccess) {
68 printf("failed to get device\n");
69 return 0;
70 }
71
72 if (cudaGetDeviceProperties(&properties, device) != cudaSuccess) {
73 printf("failed to get properties\n");
74 return 0;
75 }
76
77 return properties.major * 100 + properties.minor * 10;
78 }
79
80 size_t getDeviceMemory(void)
81 {

Callers 1

batchCUBLAS.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected