#include #include #include #include #include #include namespace migraphx { inline namespace MIGRAPHX_INLINE_NS { namespace cpu { struct cpu_preallocate : auto_register_op { shape s; std::string id = ""; argument data; template static auto reflect(Self& self, F f) { return pack(f(self.s, "shape"), f(self.id, "id")); } std::string name() const { return "cpu::preallocate"; } shape compute_shape(const std::vector& inputs) const { check_shapes{inputs, *this}.has(0); return s; } argument compute(context&, const shape&, const std::vector&) const { return data; } void finalize(context&, const shape&, const std::vector&) { data = argument(s); } lifetime get_lifetime() const { return lifetime::global; } }; } // namespace cpu } // namespace MIGRAPHX_INLINE_NS } // namespace migraphx