Skip to content
Snippets Groups Projects

Revised Array Modelling & Memory Model

Merged Frederik Hennig requested to merge fhennig/array-modelling into v2.0-dev
All threads resolved!

This MR revises the way C arrays, as well as heap memory and pointers, are modelled and translated by pystencils.

Changes concerning arrays:

  • Change PsArrayType to receive a fixed, n-dimensional, nonempty shape, and a non-const, non-array element type
  • Change PsSubscript to only work on arrays via an n-dimensional index tuple
  • Change PsArrayInitList to an n-dimensional matrix of expressions
  • Add contextual and default typing for array declarations and inline array literals

Changes concerning pointers and memory:

  • Remove PsDeref
  • Introduce PsMemAcc to access memory by pointers
  • Assume all non-field raw pointers to be aliases of each other, adapt loop-invariant code motion accordingly
  • Introduce mem_acc front-end function for accessing memory by pointer in SymPy

Changes to the typifier:

  • Remove constness handling from the type context; only work with non-const data types while processing expressions
  • In PsAssignment, use a seperate algorithm to determine the mutated memory object and its constness

Merge request reports

Pipeline #69728 passed

Pipeline passed for 72531dc1 on fhennig/array-modelling

Approved by

Merged by Frederik HennigFrederik Hennig 9 months ago (Oct 21, 2024 6:48am UTC)

Merge details

  • Changes merged into v2.0-dev with e0945b63 (commits were squashed).
  • Deleted the source branch.
  • Auto-merge enabled

Pipeline #69729 passed

Pipeline passed for e0945b63 on v2.0-dev

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 approved this merge request

    approved this merge request

  • added 1 commit

    • 72531dc1 - fix typifier documentation, rename `items_matrix` to `items_grid`.

    Compare with previous version

  • Frederik Hennig resolved all threads

    resolved all threads

  • Frederik Hennig enabled an automatic merge when the pipeline for 72531dc1 succeeds

    enabled an automatic merge when the pipeline for 72531dc1 succeeds

  • mentioned in commit e0945b63

  • mentioned in task #102 (closed)

  • mentioned in task #99 (closed)

  • mentioned in commit lbmpy@7f6f3a57

  • Please register or sign in to reply
    Loading