| 115 | MINMAXOP(max, uchar) |
| 116 | |
| 117 | TEST(IndexedReduce, MaxIndexedSmall) { |
| 118 | const int num = 1000; |
| 119 | const int st = 10; |
| 120 | const int en = num - 100; |
| 121 | array a = randu(num); |
| 122 | |
| 123 | float b; |
| 124 | unsigned idx; |
| 125 | max<float>(&b, &idx, a(seq(st, en))); |
| 126 | |
| 127 | vector<float> ha(num); |
| 128 | a.host(&ha[0]); |
| 129 | |
| 130 | float res = ha[st]; |
| 131 | for (int i = st; i <= en; i++) { res = std::max(res, ha[i]); } |
| 132 | |
| 133 | ASSERT_EQ(b, res); |
| 134 | } |
| 135 | |
| 136 | TEST(IndexedReduce, MaxIndexedBig) { |
| 137 | const int num = 100000; |