Skip to content

Fix fuse case ReadIOp.then(BatchRead<IncompleteReadBackIOp>) #359

Description

@morousg

We found that the case where we have a ReadIOp and the next is a BatchRead IOp that contains a batch of IncompleteReadBack Operations, the initializiation of Operation data fails because it is trying to copy an entire static array.

Simply, add the OperationData constructor that copies element by element:

template <typename Operation>
struct OperationData<Operation, std::enable_if_t<one_of_v<typename Operation::InstanceType, ParamsTypes>>> {
    FK_HOST_DEVICE_CNST OperationData() {};

    FK_HOST_DEVICE_CNST OperationData(const typename Operation::ParamsType& params_)
        requires(hasParamsNoArray<Operation>)
        : params(params_) {}

    FK_HOST_DEVICE_CNST OperationData(const typename Operation::ParamsType& params_)
        requires(hasParamsArray<Operation>)
        : params{} {
        for (size_t i = 0; i < std::extent_v<typename Operation::ParamsType>; ++i) {
            params[i] = params_[i];
        }
    }

    typename Operation::ParamsType params{};
};

We can use the occasion to migrate OperationData to C++20 style metaprogramming, and remove the Enabler template parameter.

Also, add some fussion tests that test the combination of different cases Single -> Batch, Batch -> Batch, Batch -> Single

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions