Skip to content

Array of Structs Transformation  #2331

@WilliamDue

Description

@WilliamDue

Currently the Futhark compiler always does a transformation to an array of records/tuples such that it becomes a tuple/record of arrays (which is commonly called a struct of arrays transformation). This is not always ideal in cases where you are doing random reading like in hash maps you would much rather have an array of structs. So I believe the Futhark language should have a feature for avoiding the struct of arrays transformation. One possible idea is to have an attribute #[aos] to put in front of expressions to tell the compiler that the array of possible tuples/records should not become an struct of arrays. In the IR the arrays are labeled and these labels are then used during allocation to braid arrays together to obtain the desired effect of having an array of structs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions