Skip to content

Commit

Permalink
RecursiveMapper -> Mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Oct 22, 2024
1 parent db13612 commit e390b53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions loopy/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import numpy as np

from pymbolic.mapper import RecursiveMapper
from pymbolic.mapper import Mapper

from loopy.codegen import UnvectorizableError
from loopy.diagnostic import LoopyError
Expand Down Expand Up @@ -55,7 +55,7 @@ def dtype_to_type_context(target, dtype):

# {{{ vectorizability checker

class VectorizabilityChecker(RecursiveMapper):
class VectorizabilityChecker(Mapper):
"""The return value from this mapper is a :class:`bool` indicating whether
the result of the expression is vectorized along :attr:`vec_iname`.
If the expression is not vectorizable, the mapper raises
Expand Down
9 changes: 4 additions & 5 deletions loopy/target/c/codegen/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import islpy as isl
import pymbolic.primitives as p
from pymbolic import var
from pymbolic.mapper import IdentityMapper, RecursiveMapper
from pymbolic.mapper import IdentityMapper, Mapper
from pymbolic.mapper.stringifier import (
PREC_BITWISE_AND,
PREC_BITWISE_OR,
Expand Down Expand Up @@ -124,9 +124,8 @@ def wrap_in_typecast(self, actual_type: LoopyType, needed_type: LoopyType, s):

return s

def rec(self, expr, type_context=None, needed_type: Optional[LoopyType] = None):
result = RecursiveMapper.rec(self, expr, type_context)

def rec(self, expr, type_context=None, needed_type: Optional[LoopyType] = None): # type: ignore[override]
result = Mapper.rec(self, expr, type_context)
if needed_type is None:
return result
else:
Expand Down Expand Up @@ -604,7 +603,7 @@ def map_nan(self, expr, type_context):

# {{{ C expression to code mapper

class CExpressionToCodeMapper(RecursiveMapper):
class CExpressionToCodeMapper(Mapper):

# {{{ helpers

Expand Down

0 comments on commit e390b53

Please sign in to comment.