Skip to content

Data type refactor - #2758

Draft
timfelle wants to merge 23 commits into
ExtremeFLOW:developfrom
timfelle:data_parent
Draft

Data type refactor#2758
timfelle wants to merge 23 commits into
ExtremeFLOW:developfrom
timfelle:data_parent

Conversation

@timfelle

@timfelle timfelle commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Work on refactoring our data types. This work extends on the tensor system and unifies our array objects under a single umbrella. The array type implements storage, while specialised types create a pointer with the appropriate shape, matrix is 2D etc.

  • Abstract array_t, the parent of all arrays. Linear storage and handles the common interfaces such as allocation, device synchronisation etc.
  • Mathematical arrays moved to the array_t system. (vector, matrix, ... )
  • Unify mathematical operations behind the shared type, keeping specialised operations separate (matrix inverse, etc).
  • Significant testing needs to happen to make sure we preserve performance.
  • Then we can discuss moving field_t to the same underlying structure.

This PR depends on #2749 #2756

timfelle and others added 21 commits August 20, 2026 06:43
Rank-3 and rank-4 counterparts to vector_t/matrix_t (src/math/), with
the same device-mirrored alloc/free, copy_from, and assignment(=)
pattern as matrix_t. Re-exported from src/neko.f90 alongside
vector_t/matrix_t. Includes pFUnit unit tests wired into make check.

Verified on CPU (45/45 unit tests) and CUDA (sm_86, RTX A3000 Laptop
GPU, 45/45 unit tests) backends.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
field_t no longer declares its own x/name/x_d - it inherits them via
extends(tensor4_t), delegating alloc/free/device-map to the parent
instead of hand-rolling them. Dropped field_size/field_copy_from and
the separate assign_scalar (all identical to the inherited tensor4_t
versions). tensor4_t's init is now a generic wrapping a private
init_dims so it can be cleanly overridden; field_t seals the two raw
tensor4-level entry points (init_dims, tensor4_assign_tensor4) that
would otherwise bypass Xh/msh/dof.

Verified on CPU and CUDA (sm_86): 45/45 unit tests pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Set proper matrix inverse calls.
@timfelle timfelle changed the title Fix hdf5 checkpoint restart exactness Data type refactor Sep 4, 2026
@timfelle timfelle self-assigned this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant