@@ -742,7 +742,7 @@ def update_context(self, context, builder):
742742
743743 if (
744744 not hasattr (cctyp , "pyomp_patch_installed" )
745- or cctyp .pyomp_patch_installed == False
745+ or not cctyp .pyomp_patch_installed
746746 ):
747747 cctyp .pyomp_patch_installed = True
748748 # print("update_context", "id(cctyp.return_user_exec)", id(cctyp.return_user_exc), "id(context)", id(context))
@@ -779,7 +779,7 @@ def pyomp_return_status_propagate(self, builder, *args, **kwargs):
779779
780780 if (
781781 not hasattr (cemtyp , "pyomp_patch_installed" )
782- or cemtyp .pyomp_patch_installed == False
782+ or not cemtyp .pyomp_patch_installed
783783 ):
784784 cemtyp .pyomp_patch_installed = True
785785 # print("update_context", "id(cemtyp.return_user_exec)", id(cemtyp.fp_zero_division), "id(context)", id(context))
@@ -799,7 +799,7 @@ def pyomp_fp_zero_division(self, builder, *args, **kwargs):
799799
800800 if (
801801 not hasattr (ptyp , "pyomp_patch_installed" )
802- or ptyp .pyomp_patch_installed == False
802+ or not ptyp .pyomp_patch_installed
803803 ):
804804 ptyp .pyomp_patch_installed = True
805805 # print("update_context", "id(ptyp.emit_environment_sentry)", id(ptyp.emit_environment_sentry), "id(context)", id(context))
@@ -838,7 +838,6 @@ def fix_dispatchers(self, typemap, typingctx, cuda_target):
838838 typemap [k ] = v
839839
840840 def lower (self , lowerer ):
841- typingctx = lowerer .context .typing_context
842841 targetctx = lowerer .context
843842 typemap = lowerer .fndesc .typemap
844843 calltypes = lowerer .fndesc .calltypes
@@ -920,7 +919,6 @@ def add_struct_tags(self, var_table):
920919 assert isinstance (cur_tag_var , str )
921920 cur_tag_typ = typemap_lookup (typemap , cur_tag_var )
922921 if isinstance (cur_tag_typ , types .npytypes .Array ):
923- cur_tag_ndim = cur_tag_typ .ndim
924922 stride_typ = lowerer .context .get_value_type (
925923 types .intp
926924 ) # lir.Type.int(64)
@@ -1082,7 +1080,7 @@ def add_struct_tags(self, var_table):
10821080 for extra in extras_before :
10831081 lowerer .lower_inst (extra )
10841082
1085- elif target_num is not None and self .target_copy != True :
1083+ elif target_num is not None and not self .target_copy :
10861084 var_table = get_name_var_table (lowerer .func_ir .blocks )
10871085
10881086 ompx_attrs = list (
@@ -1108,7 +1106,7 @@ def add_struct_tags(self, var_table):
11081106 for otag in self .tags :
11091107 print ("tag in target:" , otag , type (otag .arg ))
11101108
1111- from numba .core .compiler import Compiler , Flags
1109+ from numba .core .compiler import Flags
11121110
11131111 if DEBUG_OPENMP >= 1 :
11141112 print ("openmp start region lower has target" , type (lowerer .func_ir ))
@@ -1220,7 +1218,6 @@ def fixup_openmp_pairs(blocks):
12201218 print ("fndesc:" , fndesc , type (fndesc ))
12211219 print ("func_ir type:" , type (func_ir ))
12221220 dprint_func_ir (func_ir , "target func_ir" )
1223- internal_codegen = targetctx ._internal_codegen
12241221
12251222 # Find the start and end IR blocks for this offloaded region.
12261223 start_block , end_block = find_target_start_end (func_ir , target_num )
@@ -1585,10 +1582,6 @@ def prepend_device_to_func_name(outlined_ir):
15851582 id (func_ir .blocks [k ].body ),
15861583 )
15871584
1588- shared_ext = ".so"
1589- if sys .platform .startswith ("win" ):
1590- shared_ext = ".dll"
1591-
15921585 # TODO: move device pipelines in numba proper.
15931586 if selected_device == 1 :
15941587 if DEBUG_OPENMP >= 1 :
@@ -1911,12 +1904,7 @@ def list_vars(self):
19111904 return list_vars_from_tags (self .tags )
19121905
19131906 def lower (self , lowerer ):
1914- typingctx = lowerer .context .typing_context
1915- targetctx = lowerer .context
1916- typemap = lowerer .fndesc .typemap
1917- context = lowerer .context
19181907 builder = lowerer .builder
1919- library = lowerer .library
19201908
19211909 if DEBUG_OPENMP >= 2 :
19221910 print ("openmp_region_end::lower" , id (self ), id (self .start_region ))
@@ -1941,7 +1929,7 @@ def lower(self, lowerer):
19411929 # Process the accumulated allocas in the start region.
19421930 self .start_region .process_alloca_queue ()
19431931
1944- assert self .start_region .omp_region_var != None
1932+ assert self .start_region .omp_region_var is not None
19451933 if DEBUG_OPENMP >= 2 :
19461934 print (
19471935 "before adding exit" , self .start_region .omp_region_var ._get_name ()
0 commit comments