(device)
| 92 | raise RuntimeError("Prefix cache ops only supported CUDA nor XPU platform ") |
| 93 | |
| 94 | def set_device(device): |
| 95 | if current_platform.is_cuda(): |
| 96 | paddle.set_device(f"gpu:{device}") |
| 97 | elif current_platform.is_maca(): |
| 98 | paddle.set_device(f"metax_gpu:{device}") |
| 99 | elif current_platform.is_xpu(): |
| 100 | paddle.set_device(f"xpu:{device}") |
| 101 | else: |
| 102 | raise RuntimeError("No supported platform") |
| 103 | |
| 104 | def share_external_data_(cache, cache_name, cache_shape, use_ipc): |
| 105 | if current_platform.is_cuda(): |
no test coverage detected