MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / get_platform_name

Function get_platform_name

ui/easydiffusion/backends/sdkit3.py:227–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225
226
227def get_platform_name():
228 if OS_NAME == "Darwin":
229 return "metal"
230
231 # use torchruntime to determine if nvidia gpu is present
232 from torchruntime.device_db import get_gpus
233 from torchruntime.platform_detection import get_torch_platform
234
235 gpus = get_gpus()
236 torch_platform = get_torch_platform(gpus)
237
238 if torch_platform == "cpu":
239 return "cpu"
240
241 if torch_platform.startswith("cu"):
242 return "cuda"
243
244 return "vulkan"
245
246
247def get_variant_name(platform_name):

Callers 1

get_targetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected