Skip to content

[eudsl-python-extras] Disallow gpu.func external declarations#458

Merged
makslevental merged 1 commit into
mainfrom
users/makslevental/fix-gpu-func-value-sizes
Jun 28, 2026
Merged

[eudsl-python-extras] Disallow gpu.func external declarations#458
makslevental merged 1 commit into
mainfrom
users/makslevental/fix-gpu-func-value-sizes

Conversation

@makslevental

@makslevental makslevental commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • gpu.func requires at least one body block per MLIR semantics — external declarations are invalid.
  • Raise ValueError early in gpu.func() when the body is detected as a declaration, instead of letting it silently emit an invalid op that fails at verification time.
  • Fix test_gpu_func_call_with_value_sizes to use a non-empty body; remove @pytest.mark.xfail.
  • Add tests for the new error on declarations both at top level and inside a gpu.module.

Test plan

  • pytest tests/dialect/test_gpu.py::test_gpu_func_call_with_value_sizes passes
  • pytest tests/dialect/test_gpu.py::test_gpu_func_external_decl_raises passes
  • pytest tests/dialect/test_gpu.py::test_gpu_func_external_decl_in_gpu_module_raises passes
  • Full test suite: 589 passed, 99.23% coverage

@makslevental makslevental force-pushed the users/makslevental/fix-gpu-func-value-sizes branch 3 times, most recently from d0d8239 to fbbdd26 Compare June 28, 2026 05:37
@makslevental makslevental changed the title [eudsl-python-extras] Fix gpu.func emit inside gpu.module for empty-body kernels [eudsl-python-extras] Disallow gpu.func external declarations Jun 28, 2026
gpu.func requires at least one body block per MLIR semantics, so external
declarations (empty bodies) are invalid. Raise ValueError early when
gpu.func detects a declaration, instead of letting it fail at verification.
@makslevental makslevental force-pushed the users/makslevental/fix-gpu-func-value-sizes branch from fbbdd26 to 8f49387 Compare June 28, 2026 06:29
@makslevental makslevental merged commit 893e48a into main Jun 28, 2026
20 checks passed
@makslevental makslevental deleted the users/makslevental/fix-gpu-func-value-sizes branch June 28, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant