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

Function getCudaAttribute

cpp/1_Utilities/deviceQuery/deviceQuery.cpp:48–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47// This function wraps the CUDA Driver API into a template function
48template <class T> inline void getCudaAttribute(T *attribute, CUdevice_attribute device_attribute, int device)
49{
50 CUresult error = cuDeviceGetAttribute(attribute, device_attribute, device);
51
52 if (CUDA_SUCCESS != error) {
53 fprintf(
54 stderr, "cuSafeCallNoSync() Driver API error = %04d from file <%s>, line %i.\n", error, __FILE__, __LINE__);
55
56 exit(EXIT_FAILURE);
57 }
58}
59
60#endif /* CUDART_VERSION < 5000 */
61

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected