mirror of
https://github.com/sgjzfzzf/triton-tvm-ffi.git
synced 2026-05-02 03:52:11 +08:00
fix bugs on lacking cudatoolkit
Signed-off-by: Jinjie Liu <jjliu@baai.ac.cn>
This commit is contained in:
@@ -155,22 +155,28 @@ def torch_wrap(
|
||||
extra_ldflags: Optional[Sequence[str]] = None,
|
||||
extra_include_paths: Optional[Sequence[Union[str, Path]]] = None,
|
||||
) -> TVMFFIWrapperFunction:
|
||||
cuda_home: str = tvm_ffi.cpp.extension._find_cuda_home()
|
||||
return wrap(
|
||||
name,
|
||||
fns,
|
||||
code,
|
||||
extra_ldflags=[
|
||||
"-Wl,--no-as-needed",
|
||||
f"-L{cuda_home}/lib64",
|
||||
*map(
|
||||
lambda path: f"-L{path}",
|
||||
torch.utils.cpp_extension.library_paths(),
|
||||
),
|
||||
"-lcuda",
|
||||
"-lc10",
|
||||
"-ltorch",
|
||||
]
|
||||
+ (extra_ldflags or []),
|
||||
extra_cflags=extra_cflags,
|
||||
extra_cuda_cflags=extra_cuda_cflags,
|
||||
extra_include_paths=[*torch.utils.cpp_extension.include_paths()]
|
||||
extra_include_paths=[
|
||||
f"{cuda_home}/include",
|
||||
*torch.utils.cpp_extension.include_paths(),
|
||||
]
|
||||
+ (extra_include_paths or []),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user