string getDeviceInfo() { const CPUInfo cinfo = DeviceManager::getInstance().getCPUInfo(); ostringstream info; info << "ArrayFire v" << AF_VERSION << " (CPU, " << get_system() << ", build " << AF_REVISION << ")" << endl; string model = cinfo.model(); size_t memMB = getDeviceMemorySize(getActiveDeviceId()) / 1048576; info << string("[0] ") << cinfo.vendor() << ": " << ltrim(model); if (memMB) info << ", " << memMB << " MB, "; else info << ", Unknown MB, "; info << "Max threads(" << cinfo.threads() << ") "; #ifndef NDEBUG info << AF_COMPILER_STR; #endif info << endl; return info.str(); }
void devprop(char* d_name, char* d_platform, char* d_toolkit, char* d_compute) { const CPUInfo cinfo = DeviceManager::getInstance().getCPUInfo(); snprintf(d_name, 64, "%s", cinfo.vendor().c_str()); snprintf(d_platform, 10, "CPU"); // report the compiler for toolkit snprintf(d_toolkit, 64, "%s", AF_COMPILER_STR); snprintf(d_compute, 10, "%s", "0.0"); }