loopy/schedule/device_mapping.py
def filter_items_by_varname(pred, kernel, items):
    """
    Keep only the values in `items` whose variable names satisfy `pred`.
    """
    from pymbolic.primitives import Subscript, Variable
    result = set()
    for item in items:
        base = item
        if isinstance(base, Subscript):
            base = base.aggregate
        if isinstance(base, Variable):
            base = base.name
        if pred(kernel, base):
            result.add(item)
    return result

    Keep only the values in `items` whose variable names satisfy `pred`.
    
Keep only the values in `items` whose variable names satisfy `pred`.
Keep only the values in ` items ` whose variable names satisfy ` pred ` .
def filter_items_by_varname(pred, kernel, items):
    from pymbolic.primitives import Subscript, Variable
    result = set()
    for item in items:
        base = item
        if isinstance(base, Subscript):
            base = base.aggregate
        if isinstance(base, Variable):
            base = base.name
        if pred(kernel, base):
            result.add(item)
    return result
def filter_items_by_varname ( pred , kernel , items ) : from pymbolic . primitives import Subscript , Variable result = set ( ) for item in items : base = item if isinstance ( base , Subscript ) : base = base . aggregate if isinstance ( base , Variable ) : base = base . name if pred ( kernel , base ) : result . add ( item ) return result
Keep only the values in `items` whose variable names satisfy `pred`.
Keep only the values in ` items ` whose variable names satisfy ` pred ` .
"""
    Keep only the values in `items` whose variable names satisfy `pred`.
    """
pred
kernel
items