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

Function decide_module

fastdeploy/model_executor/ops/gpu/__init__.py:23–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def decide_module():
24 import os
25
26 import paddle
27
28 # Use paddle.device.get_device_properties() instead of paddle.device.cuda.get_device_properties()
29 # to support all hardware platforms (NVIDIA, ILUVATAR, HPU, etc.)
30 prop = paddle.device.get_device_properties()
31 sm_version = prop.major * 10 + prop.minor
32 print(f"current sm_version={sm_version}")
33
34 curdir = os.path.dirname(os.path.abspath(__file__))
35 sm_version_path = os.path.join(curdir, f"fastdeploy_ops_{sm_version}")
36 if os.path.exists(sm_version_path):
37 return f".fastdeploy_ops_{sm_version}.fastdeploy_ops"
38 return ".fastdeploy_ops"
39
40
41module_path = ".fastdeploy_ops"

Callers 1

__init__.pyFile · 0.85

Calls 3

printFunction · 0.85
joinMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected