#pragma once #include template struct Operator { bool* const mask; const std::tuple config; Operator(OPERATOR, DeviceBuffer& m, ARGS... args): mask(m.device()), config(args...) { } template __device__ bool apply(DESCRIPTOR d, S f_curr[DESCRIPTOR::q], S f_next[DESCRIPTOR::q], std::size_t gid) const { if (mask[gid]) { std::apply([](auto... args) { OPERATOR::template apply(args...); }, std::tuple_cat(std::make_tuple(d, f_curr, f_next, gid), config)); return true; } else { return false; } } }; template Operator(OPERATOR, DeviceBuffer&, ARGS... args) -> Operator...>;