Skip to content

SoA should allow arbitrary initialization of matrix if it isn't elementwise accessed thereafter #1503

@WardBrian

Description

@WardBrian

Currently, the memory pattern optimization relies on all functions being inlined and then searches for elementwise accesses as its heuristic to disable function promotion.

It would be really nice if we instead allowed things like

transformed parameters {
  matrix[N,M] foo = some_function(N, M, other_arguments) + possibly_other_expressions;
}

to be code generated to something like auto foo = to_soa(some_function(...) ...) when there are no further elementwise accesses of foo, even if the code in some_function does use for-loops to construct it. This is sort of on-the-way to something like a comprehension, but I believe it is implementable right now for many models.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions