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

Function getDeviceInfo

src/backend/cpu/platform.cpp:52–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50int getBackend() { return AF_BACKEND_CPU; }
51
52string getDeviceInfo() noexcept {
53 const CPUInfo cinfo = DeviceManager::getInstance().getCPUInfo();
54
55 ostringstream info;
56
57 info << "ArrayFire v" << AF_VERSION << " (CPU, " << get_system()
58 << ", build " << AF_REVISION << ")" << endl;
59
60 string model = cinfo.model();
61
62 size_t memMB =
63 getDeviceMemorySize(static_cast<int>(getActiveDeviceId())) / 1048576;
64
65 info << string("[0] ") << cinfo.vendor() << ": " << ltrim(model);
66
67 if (memMB) {
68 info << ", " << memMB << " MB, ";
69 } else {
70 info << ", Unknown MB, ";
71 }
72
73 info << "Max threads(" << cinfo.threads() << ") ";
74#ifndef NDEBUG
75 info << AF_COMPILER_STR;
76#endif
77 info << endl;
78
79 return info.str();
80}
81
82bool isDoubleSupported(int device) {
83 UNUSED(device);

Callers 2

af_infoFunction · 0.50
af_info_stringFunction · 0.50

Calls 7

getCPUInfoMethod · 0.80
modelMethod · 0.80
vendorMethod · 0.80
threadsMethod · 0.80
get_systemFunction · 0.70
getDeviceMemorySizeFunction · 0.70
getActiveDeviceIdFunction · 0.70

Tested by

no test coverage detected