diff --git a/numba_dpex/core/passes/dufunc_inliner.py b/numba_dpex/core/passes/dufunc_inliner.py index 17b11cf706..d59ebf98f7 100644 --- a/numba_dpex/core/passes/dufunc_inliner.py +++ b/numba_dpex/core/passes/dufunc_inliner.py @@ -116,13 +116,8 @@ def _is_dufunc_callsite(expr, block): def dufunc_inliner(func_ir, calltypes, typemap, typingctx, targetctx): - _DEBUG = False modified = False - if _DEBUG: - print("GUFunc before inlining DUFunc".center(80, "-")) - print(func_ir.dump()) - work_list = list(func_ir.blocks.items()) # use a work list, look for call sites via `ir.Expr.op == call` and # then pass these to `self._do_work` to make decisions about inlining. @@ -152,11 +147,6 @@ def dufunc_inliner(func_ir, calltypes, typemap, typingctx, targetctx): break # because block structure changed else: continue - if _DEBUG: - print("GUFunc after inlining DUFunc".center(80, "-")) - print(func_ir.dump()) - print("".center(80, "-")) - if modified: # clean up leftover load instructions. This step is needed or else # SpirvLowerer would complain @@ -165,9 +155,4 @@ def dufunc_inliner(func_ir, calltypes, typemap, typingctx, targetctx): # functions introducing blocks func_ir.blocks = simplify_CFG(func_ir.blocks) - if _DEBUG: - print("GUFunc after inlining DUFunc, DCE, SimplyCFG".center(80, "-")) - print(func_ir.dump()) - print("".center(80, "-")) - return True diff --git a/numba_dpex/core/passes/passes.py b/numba_dpex/core/passes/passes.py index 19aa5b67a5..1bc1ab42aa 100644 --- a/numba_dpex/core/passes/passes.py +++ b/numba_dpex/core/passes/passes.py @@ -31,15 +31,6 @@ def run_pass(self, state): assert state.func_ir func_ir = state.func_ir - _DEBUG = False - - if _DEBUG: - print( - "Checks if size of OpenCL local address space alloca is a " - + "compile-time constant.".center(80, "-") - ) - print(func_ir.dump()) - work_list = list(func_ir.blocks.items()) while work_list: label, block = work_list.pop() diff --git a/numba_dpex/core/types/dpnp_ndarray_type.py b/numba_dpex/core/types/dpnp_ndarray_type.py index 04edec02b1..9fc32c909c 100644 --- a/numba_dpex/core/types/dpnp_ndarray_type.py +++ b/numba_dpex/core/types/dpnp_ndarray_type.py @@ -59,7 +59,7 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): return def __str__(self): - return self.name.replace("USMNdArray", "DpnpNdarray") + return self.name.replace("USMNdArray", "DpnpNdArray") def __repr__(self): return self.__str__() @@ -193,47 +193,6 @@ def __allocate__( # enable this code path. raise NotImplementedError("F Arrays are not yet supported") - empty_c_typ = lhs_typ.copy(layout="C") - empty_c_var = ir.Var(scope, mk_unique_var("$empty_c_var"), loc) - if typemap: - typemap[empty_c_var.name] = lhs_typ.copy(layout="C") - empty_c_assign = ir.Assign(alloc_call, empty_c_var, loc) - - # attr call: asfortranarray = getattr(g_np_var, asfortranarray) - asfortranarray_attr_call = ir.Expr.getattr( - g_np_var, "asfortranarray", loc - ) - afa_attr_var = ir.Var( - scope, mk_unique_var("$asfortran_array_attr"), loc - ) - if typemap: - typemap[afa_attr_var.name] = get_np_ufunc_typ( - dpnp.asfortranarray - ) - afa_attr_assign = ir.Assign( - asfortranarray_attr_call, afa_attr_var, loc - ) - # call asfortranarray - asfortranarray_call = ir.Expr.call( - afa_attr_var, [empty_c_var], (), loc - ) - if calltypes: - calltypes[asfortranarray_call] = typemap[ - afa_attr_var.name - ].get_call_type(typingctx, [empty_c_typ], {}) - - asfortranarray_assign = ir.Assign(asfortranarray_call, lhs, loc) - - out.extend( - [ - g_np_assign, - attr_assign, - typ_var_assign, - empty_c_assign, - afa_attr_assign, - asfortranarray_assign, - ] - ) else: alloc_assign = ir.Assign(alloc_call, lhs, loc) out.extend([g_np_assign, attr_assign, typ_var_assign, alloc_assign])