Skip to content

[BUG] Prevent assignment from element-wise ops on same input #1025

@cliffburdick

Description

@cliffburdick

Currently if a user has an input tensor that writes to the same output tensor this is fine as long as the element-wise operation doesn't change index positions. All scalar operators follow this pattern. However, for operators that change the output index, writing to the same buffer causes a race condition:

(a = fftshift1D(a)).run();

We need to do one of two things:

  1. Raise an error when this situation occurs
  2. Async-allocate memory to temporarily do the transform and make a copy afterwards.

2 is preferred because the user would have to do this anyways if they were to implement it themselves.

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