Skip to content
Snippets Groups Projects

Fix kernel function parameters

Closed Daniel Bauer requested to merge hyteg/pystencils:bauerd/kernel-params into backend-rework
1 unresolved thread

This MR implements equality and hashing for PsSymbol such that the parameters of KernelFunctions are unique.

Also improves some error messages.

Merge request reports

Pipeline #64791 passed

Pipeline passed for f5ef2d89 on hyteg:bauerd/kernel-params

Checking approval status

Closed by Daniel BauerDaniel Bauer 1 year ago (Mar 28, 2024 12:47pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Daniel Bauer requested review from @da15siwa

    requested review from @da15siwa

  • assigned to @he66coqe

  • Daniel Bauer added 1 commit

    added 1 commit

    • f5ef2d89 - fix lint and static type check

    Compare with previous version

    • Content-based equality and hashing for PsSymbol were not implemented intentionally to make sure that for every symbol, only one instance ever exists in the backend, and all symbol instances are known to and managed by the KernelCreationContext.

      This is necessary so that changes to a symbol in one place (e.g. setting or updating the data type) are immediately reflected across the AST. If we allow multiple instances of PsSymbol to refer to the same object, the PsSymbol cannot be mutable, and a lot of transformations become harder to implement.

      The KernelCreationContext acts as a symbol table; as long as you stick to using its interface (i.e. get_symbol), you should never get symbol duplicates.

    • Thanks for the explanation. Now I remember reading that in the documentation ^^

    • Please register or sign in to reply
  • closed

Please register or sign in to reply