()
| 38 | |
| 39 | |
| 40 | def num_available_gpus(): |
| 41 | local_devices = device_lib.list_local_devices() |
| 42 | num_gpus = sum(1 for device in local_devices if device.device_type == "GPU") |
| 43 | if not math.log2(num_gpus).is_integer(): |
| 44 | raise RuntimeError("Unsupported number of GPUs. This test can run on: 2^n GPUs.") |
| 45 | return num_gpus |
| 46 | |
| 47 | |
| 48 | def available_gpus(): |
no test coverage detected