MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / devprop

Function devprop

src/backend/cuda/platform.cpp:284–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void devprop(char *d_name, char *d_platform, char *d_toolkit, char *d_compute) {
285 if (getDeviceCount() <= 0) { return; }
286
287 const cudaDeviceProp &dev = getDeviceProp(getActiveDeviceId());
288
289 // Name
290 snprintf(d_name, 256, "%s", dev.name);
291
292 // Platform
293 string cudaRuntime = getCUDARuntimeVersion();
294 snprintf(d_platform, 10, "CUDA");
295 snprintf(d_toolkit, 64, "v%s", cudaRuntime.c_str());
296
297 // Compute Version
298 snprintf(d_compute, 10, "%d.%d", dev.major, dev.minor);
299
300 // Sanitize input
301 for (int i = 0; i < 256; i++) {
302 if (d_name[i] == ' ') {
303 if (d_name[i + 1] == 0 || d_name[i + 1] == ' ') {
304 d_name[i] = 0;
305 } else {
306 d_name[i] = '_';
307 }
308 }
309 }
310}
311
312string getDriverVersion() noexcept {
313 char driverVersion[1024] = {" "};

Callers

nothing calls this directly

Calls 3

getCUDARuntimeVersionFunction · 0.85
getDeviceCountFunction · 0.70
getActiveDeviceIdFunction · 0.70

Tested by

no test coverage detected