Skip to content

Commit

Permalink
[Fix] Fix compile error (hpcaitech#4357)
Browse files Browse the repository at this point in the history
  • Loading branch information
HAOCHENYE authored Sep 1, 2023
1 parent eb952ea commit cfa6070
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion op_builder/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ def get_cuda_cc_flag() -> List[str]:
import torch

cc_flag = []
max_arch = ''.join(str(i) for i in torch.cuda.get_device_capability())
for arch in torch.cuda.get_arch_list():
res = re.search(r'sm_(\d+)', arch)
if res:
arch_cap = res[1]
if int(arch_cap) >= 60:
if int(arch_cap) >= 60 and int(arch_cap) <= int(max_arch):
cc_flag.extend(['-gencode', f'arch=compute_{arch_cap},code={arch}'])
return cc_flag

Expand Down

0 comments on commit cfa6070

Please sign in to comment.