MCPcopy Create free account
hub / github.com/alibaba/MNN / run

Method run

test/core/BackendTest.cpp:732–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730class CPUBackendCopyBufferTest : public MNNTestCase {
731public:
732 virtual bool run(int precision) {
733 auto type = MNN_FORWARD_CPU;
734 auto creator = MNNGetExtraRuntimeCreator(type);
735 for (int p = 0; p < 3; ++p) {
736 MNN::Backend::Info info;
737 info.type = type;
738 BackendConfig user;
739 user.precision = (MNN::BackendConfig::PrecisionMode)p;
740 info.user = &user;
741 std::shared_ptr<Runtime> runtime(creator->onCreate(info));
742 MNN_PRINT("Test %d Backend for %d \n", type, user.precision);
743 std::shared_ptr<Backend> bn(runtime->onCreate(&user));
744 auto res = NC4HW4_2_NC4HW4_IntType<int32_t>(bn);
745 res = res && NC4HW4_2_NC4HW4_IntType<int16_t>(bn);
746 res = res && NC4HW4_2_NC4HW4_IntType<int8_t>(bn);
747 res = res && nhwc_2_NC4HW4_2_nhwc_inttype<int32_t>(bn);
748 res = res && nhwc_2_NC4HW4_2_nhwc_inttype<int16_t>(bn);
749 res = res && nhwc_2_NC4HW4_2_nhwc_inttype<int8_t>(bn);
750 if (!res) {
751 MNN_ERROR("Error for Int Copy\n");
752 return false;
753 }
754 }
755 return true;
756 }
757};
758
759class BackendCopyBufferUint8Test : public MNNTestCase {

Callers

nothing calls this directly

Calls 2

onCreateMethod · 0.45

Tested by

no test coverage detected