@@ -122,8 +122,15 @@ def __init__(self):
122122 self .libomptarget_arch = (
123123 libpath / "libomp" / "lib" / f"libomptarget-nvptx-{ self .sm } .bc"
124124 )
125- with open (self .libomptarget_arch , "rb" ) as f :
126- libomptarget_mod = ll .parse_bitcode (f .read ())
125+
126+ try :
127+ with open (self .libomptarget_arch , "rb" ) as f :
128+ libomptarget_mod = ll .parse_bitcode (f .read ())
129+ except FileNotFoundError :
130+ raise RuntimeError (
131+ f"Device RTL for architecture { self .sm } not found. Check compute capability with LLVM version { '.' .join (map (str , ll .llvm_version_info ))} ."
132+ )
133+
127134 ## Link in device, openmp libraries.
128135 self .libs_mod .link_in (libomptarget_mod )
129136 # Initialize asm printers to codegen ptx.
@@ -1493,7 +1500,9 @@ def add_mapped_to_ins(ins, tags):
14931500 # include a branch converging variable $cp. Remove it to avoid the
14941501 # assert since the openmp region must be single-entry, single-exit.
14951502 if sys .version_info >= (3 , 10 ) and sys .version_info < (3 , 11 ):
1496- assert len (target_args ) == len ([x for x in target_args_unordered if x != "$cp" ])
1503+ assert len (target_args ) == len (
1504+ [x for x in target_args_unordered if x != "$cp" ]
1505+ )
14971506 else :
14981507 assert len (target_args ) == len (target_args_unordered )
14991508 assert len (target_args ) == len (outline_arg_typs )
0 commit comments