MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / set_device

Function set_device

fastdeploy/cache_manager/ops.py:94–102  ·  view source on GitHub ↗
(device)

Source from the content-addressed store, hash-verified

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():

Callers 3

mainFunction · 0.90
_init_gpu_cacheMethod · 0.90

Calls 3

is_cudaMethod · 0.45
is_macaMethod · 0.45
is_xpuMethod · 0.45

Tested by

no test coverage detected