Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relaxing the restriction of the derived variables to have the same type as the operands #4291

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

anagainaru
Copy link
Contributor

@anagainaru anagainaru commented Aug 6, 2024

For derived operations that do not have the same input and output type, e.g. float sqrt(int)

DerivedData contains now in addition to the data pointer and the start and count Dims, the type of each input operand. The derived functions will have the following signature:

struct DerivedData
{
    void *Data;
    Dims Start;
    Dims Count;
    DataType Type;
};
    std::function<DerivedData(std::vector<DerivedData>, DataType)> ComputeFct;

The second argument DataType is the output type.

@anagainaru anagainaru marked this pull request as ready for review August 8, 2024 16:50
@anagainaru anagainaru changed the title [WIP] Relaxing the restriction of the derived variables to have the same type as the operands Relaxing the restriction of the derived variables to have the same type as the operands Aug 8, 2024
Copy link
Member

@eisenhauer eisenhauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any testing? Or just taking this piece-wise?

(I won't approve yet because you need to turn derived variables back off and when you push a commit to do that it'll dismiss any reviews anyway.)

@anagainaru
Copy link
Contributor Author

anagainaru commented Aug 8, 2024

Any testing? Or just taking this piece-wise?

I tested it separately with the POW/SQRT functions that are coming in #4248

I wanted this a separate PR because it creates a backbone for all other functions that need this, not just pow/sqrt (in case we squash merge that one). A slightly complicated way of organizing this, but it made sense at the time.

(I won't approve yet because you need to turn derived variables back off and when you push a commit to do that it'll dismiss any reviews anyway.)

Yes, I'll turn it OFF once I confirm there's no error.

@anagainaru anagainaru merged commit e524dce into ornladios:master Aug 8, 2024
42 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants