#pragma once #include "./checker.h" #include "megdnn/oprs.h" namespace megdnn { namespace test { class NonZeroTestcase { public: std::unique_ptr m_mem; NonZero::Param m_param; TensorND m_data; std::vector correct_answer; NonZeroTestcase(NonZero::Param param, const TensorLayout& data) : m_param(param), m_data(nullptr, data) {} using Result = TensorND; using CUDAResult = std::shared_ptr; Result run_naive(NonZero* opr); CUDAResult run_cuda(NonZero* opr); static std::vector make(); static void Assert( std::vector& correct_answer, int ndim, NonZeroTestcase::Result result); }; } // namespace test } // namespace megdnn