Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions loopy/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ class AtomicNumpyType(NumpyType, AtomicType):
def __hash__(self):
return 0xa7031c ^ hash(self.dtype)

@override
def update_persistent_hash(self, key_hash: Hash, key_builder: KeyBuilder) -> None:
key_builder.rec(key_hash, 0xa7031c)
key_builder.rec(key_hash, self.dtype)

@override
def __repr__(self):
return "np_atomic:%s" % repr(self.dtype)

Expand Down
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,34 @@ reportUnknownArgumentType = "none"
reportUnknownMemberType = "hint"
reportUnknownParameterType = "none"
reportUnknownVariableType = "none"

[tool.pyrefly]
project-includes = [
"**/*.py*",
]
project-excludes = [
"proto-tests/*.py",
"contrib/mem-pattern-explorer/*.py",
"loopy/ipython_ext.py",
"loopy/frontend/fortran/*.py",
"doc",
".conda-root",
".venv",
]
preset = "strict"
infer-with-first-use = false

[tool.pyrefly.errors]
implicit-any-parameter = "ignore"
implicit-any-empty-container = "ignore"
missing-override-decorator = "warn"
bad-override = "warn"

[[tool.pyrefly.sub-config]]
matches = "test/*.py"
[tool.pyrefly.sub-config.errors]
missing-override-decorator = "ignore"
bad-override-param-name = "ignore"

bad-argument-type = "warn"
missing-attribute = "warn"
Empty file added test/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions test/test_callables.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_register_function_lookup(ctx_factory: cl.CtxFactory):
queue = cl.CommandQueue(ctx)
rng = np.random.default_rng(seed=42)

from testlib import Log2Callable
from .testlib import Log2Callable

x = rng.random(size=10)
queue = cl.CommandQueue(ctx)
Expand Down Expand Up @@ -754,7 +754,7 @@ def test_passing_scalar_as_indexed_subscript_in_clbl_knl(inline: bool):


def test_symbol_mangler_in_call():
from library_for_test import preamble_for_x, symbol_x
from .library_for_test import preamble_for_x, symbol_x
ctx = cl.create_some_context()
cq = cl.CommandQueue(ctx)

Expand Down
6 changes: 3 additions & 3 deletions test/test_loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ def test_call_with_no_returned_value(ctx_factory: cl.CtxFactory):
[lp.CallInstruction((), p.Call(p.Variable("f"), ()))]
)

from library_for_test import NoRetFunction
from .library_for_test import NoRetFunction
knl = lp.register_callable(knl, "f", NoRetFunction("f"))

_evt, _ = knl(queue)
Expand All @@ -1554,7 +1554,7 @@ def test_call_with_options():
"f() {id=init}"
)

from library_for_test import NoRetFunction
from .library_for_test import NoRetFunction
knl = lp.register_callable(knl, "f", NoRetFunction("f"))

print(lp.generate_code_v2(knl).device_code())
Expand Down Expand Up @@ -2298,7 +2298,7 @@ def test_barrier_in_overridden_get_grid_size_expanded_kernel():
vecsize = 16
prog = lp.split_iname(prog, "i", vecsize, inner_tag="l.0")

from testlib import GridOverride
from .testlib import GridOverride

# artificially expand via overridden_get_grid_sizes_for_insn_ids
knl = prog["loopy_kernel"]
Expand Down
2 changes: 1 addition & 1 deletion test/test_numa_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_gnuma_horiz_kernel(ctx_factory: cl.CtxFactory, ilp_multiple, Nq, opt_le
# hsv = hsv_s
hsv = lp.add_nosync(hsv, "any", "writes:rhsQ", "writes:rhsQ", force=True)

from gnuma_loopy_transforms import (
from .gnuma_loopy_transforms import (
fix_euler_parameters,
set_D_storage_format,
set_q_storage_format,
Expand Down
Loading