@@ -1017,6 +1017,78 @@ TEST_F(QnnHTPBackendTests, BinaryOp_HTP_Or_Unsupported) {
1017
1017
ExpectedEPNodeAssignment::All);
1018
1018
}
1019
1019
1020
+ // Test ScatterND with reduction ADD on HTP
1021
+ TEST_F (QnnHTPBackendTests, ScatterND_int64_int64_reduction_add) {
1022
+ std::vector<int64_t > data = {0 , 1 , 2 , 3 };
1023
+ std::vector<int64_t > indices = {1 };
1024
+ std::vector<int64_t > updates = {10 };
1025
+ RunOpTest<int64_t >(" ScatterND" ,
1026
+ {
1027
+ TestInputDef<int64_t >({4 }, false , std::move (data)),
1028
+ TestInputDef<int64_t >({1 , 1 }, false , std::move (indices)),
1029
+ TestInputDef<int64_t >({1 }, false , std::move (updates)),
1030
+ },
1031
+ {
1032
+ utils::MakeAttribute (" reduction" , " add" ),
1033
+ },
1034
+ 17 ,
1035
+ ExpectedEPNodeAssignment::All);
1036
+ }
1037
+
1038
+ // Test ScatterND with reduction Mul on HTP
1039
+ TEST_F (QnnHTPBackendTests, ScatterND_int64_int64_reduction_mul) {
1040
+ std::vector<int64_t > data = {0 , 1 , 2 , 3 };
1041
+ std::vector<int64_t > indices = {1 };
1042
+ std::vector<int64_t > updates = {10 };
1043
+ RunOpTest<int64_t >(" ScatterND" ,
1044
+ {
1045
+ TestInputDef<int64_t >({4 }, false , std::move (data)),
1046
+ TestInputDef<int64_t >({1 , 1 }, false , std::move (indices)),
1047
+ TestInputDef<int64_t >({1 }, false , std::move (updates)),
1048
+ },
1049
+ {
1050
+ utils::MakeAttribute (" reduction" , " mul" ),
1051
+ },
1052
+ 17 ,
1053
+ ExpectedEPNodeAssignment::All);
1054
+ }
1055
+
1056
+ // Test ScatterND with reduction Max on CPU Fallback
1057
+ TEST_F (QnnHTPBackendTests, ScatterND_int64_int64_reduction_max) {
1058
+ std::vector<int64_t > data = {0 , 1 , 2 , 3 };
1059
+ std::vector<int64_t > indices = {1 };
1060
+ std::vector<int64_t > updates = {10 };
1061
+ RunOpTest<int64_t >(" ScatterND" ,
1062
+ {
1063
+ TestInputDef<int64_t >({4 }, false , std::move (data)),
1064
+ TestInputDef<int64_t >({1 , 1 }, false , std::move (indices)),
1065
+ TestInputDef<int64_t >({1 }, false , std::move (updates)),
1066
+ },
1067
+ {
1068
+ utils::MakeAttribute (" reduction" , " max" ),
1069
+ },
1070
+ 17 ,
1071
+ ExpectedEPNodeAssignment::None);
1072
+ }
1073
+
1074
+ // Test ScatterND with reduction Min on CPU Fallback
1075
+ TEST_F (QnnHTPBackendTests, ScatterND_int64_int64_reduction_min) {
1076
+ std::vector<int64_t > data = {0 , 1 , 2 , 3 };
1077
+ std::vector<int64_t > indices = {1 };
1078
+ std::vector<int64_t > updates = {10 };
1079
+ RunOpTest<int64_t >(" ScatterND" ,
1080
+ {
1081
+ TestInputDef<int64_t >({4 }, false , std::move (data)),
1082
+ TestInputDef<int64_t >({1 , 1 }, false , std::move (indices)),
1083
+ TestInputDef<int64_t >({1 }, false , std::move (updates)),
1084
+ },
1085
+ {
1086
+ utils::MakeAttribute (" reduction" , " min" ),
1087
+ },
1088
+ 17 ,
1089
+ ExpectedEPNodeAssignment::None);
1090
+ }
1091
+
1020
1092
// Test 8-bit QDQ GridSample with bilinear
1021
1093
TEST_F (QnnHTPBackendTests, GridSample_Bilinear) {
1022
1094
RunQDQOpTest<uint8_t >(" GridSample" ,
0 commit comments