| 220 | int getBackend() { return AF_BACKEND_CUDA; } |
| 221 | |
| 222 | string getDeviceInfo(int device) noexcept { |
| 223 | const cudaDeviceProp &dev = getDeviceProp(device); |
| 224 | |
| 225 | size_t mem_gpu_total = dev.totalGlobalMem; |
| 226 | // double cc = double(dev.major) + double(dev.minor) / 10; |
| 227 | |
| 228 | bool show_braces = getActiveDeviceId() == device; |
| 229 | |
| 230 | string id = (show_braces ? string("[") : "-") + to_string(device) + |
| 231 | (show_braces ? string("]") : "-"); |
| 232 | string name(dev.name); |
| 233 | string memory = to_string((mem_gpu_total / (1024 * 1024)) + |
| 234 | !!(mem_gpu_total % (1024 * 1024))) + |
| 235 | string(" MB"); |
| 236 | string compute = string("CUDA Compute ") + to_string(dev.major) + |
| 237 | string(".") + to_string(dev.minor); |
| 238 | |
| 239 | string info = id + string(" ") + name + string(", ") + memory + |
| 240 | string(", ") + compute + string("\n"); |
| 241 | return info; |
| 242 | } |
| 243 | |
| 244 | string getDeviceInfo() noexcept { |
| 245 | ostringstream info; |
nothing calls this directly
no test coverage detected