()
| 21 | |
| 22 | |
| 23 | def 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 | |
| 41 | module_path = ".fastdeploy_ops" |
no test coverage detected