| 687 | class BackendCopyBufferFloatTest : public MNNTestCase { |
| 688 | public: |
| 689 | virtual bool run(int precision) { |
| 690 | for (int i = 0; i < MNN_FORWARD_ALL; ++i) { |
| 691 | auto type = (MNNForwardType)i; |
| 692 | auto creator = MNNGetExtraRuntimeCreator(type); |
| 693 | if (nullptr == creator) { |
| 694 | continue; |
| 695 | } |
| 696 | for (int p = 0; p < 3; ++p) { |
| 697 | MNN::Backend::Info info; |
| 698 | info.type = type; |
| 699 | BackendConfig user; |
| 700 | user.precision = (MNN::BackendConfig::PrecisionMode)p; |
| 701 | info.user = &user; |
| 702 | std::shared_ptr<Runtime> runtime(creator->onCreate(info)); |
| 703 | MNN_PRINT("Test %d Backend for %d \n", type, user.precision); |
| 704 | std::shared_ptr<Backend> bn(runtime->onCreate(&user)); |
| 705 | bool res = true; |
| 706 | res = NC4HW4_2_NC4HW4_float(bn); |
| 707 | FUNC_PRINT(res); |
| 708 | res = res && nchwTonhwc(bn); |
| 709 | FUNC_PRINT(res); |
| 710 | res = res && nchwTonhwc3Dim(bn); |
| 711 | FUNC_PRINT(res); |
| 712 | res = res && nhwc_2_NC4HW4_2_nhwc_float(bn); |
| 713 | FUNC_PRINT(res); |
| 714 | res = res && NCHW_NC4HW4_NCHW(bn, 3, 16, 17, 19); |
| 715 | FUNC_PRINT(res); |
| 716 | res = res && NCHW_NC4HW4_NCHW(bn, 12, 16, 38, 16); |
| 717 | FUNC_PRINT(res); |
| 718 | res = res && NCHW_NC4HW4_NCHW(bn, 5, 128, 8, 6); |
| 719 | FUNC_PRINT(res); |
| 720 | if (!res) { |
| 721 | MNN_ERROR("Error for %d bn\n", i); |
| 722 | return false; |
| 723 | } |
| 724 | } |
| 725 | } |
| 726 | return true; |
| 727 | } |
| 728 | }; |
| 729 | |
| 730 | class CPUBackendCopyBufferTest : public MNNTestCase { |
nothing calls this directly
no test coverage detected