()
| 16 | |
| 17 | |
| 18 | def _get_module(): |
| 19 | global _module |
| 20 | if _module is not None: |
| 21 | return _module |
| 22 | _module = load( |
| 23 | name="fmms_cuda", |
| 24 | sources=[str(_CSRC_DIR / "fmms_kernel.cu")], |
| 25 | extra_cuda_cflags=[ |
| 26 | "-O3", |
| 27 | "--use_fast_math", |
| 28 | f"-gencode=arch=compute_{_sm_version()},code=sm_{_sm_version()}", |
| 29 | ], |
| 30 | verbose=os.environ.get("FMMS_CUDA_VERBOSE", "") == "1", |
| 31 | ) |
| 32 | return _module |
| 33 | |
| 34 | |
| 35 | def _sm_version() -> str: |
no test coverage detected