| 246 | constexpr auto M = Convolution::Mode::CROSS_CORRELATION; |
| 247 | |
| 248 | TEST_F(CUDA, CHANWISE_CONVOLUTION_FORWARD) { |
| 249 | Checker<Convolution> checker(handle_cuda()); |
| 250 | bool require_algo = false; |
| 251 | checker.set_before_exec_callback(AlgoChecker<ConvolutionForward>( |
| 252 | ExecutionPolicyAlgoName{ |
| 253 | "DEFAULT", |
| 254 | {{ConvBiasForward::algo_name<ConvBiasForward::DirectParam>( |
| 255 | "CHANNEL_WISE", {}) |
| 256 | .c_str(), |
| 257 | {}}}}, |
| 258 | &require_algo)); |
| 259 | |
| 260 | for (auto dtype : std::vector<DType>{dtype::Float32(), dtype::Float16()}) { |
| 261 | checker.set_dtype(0, dtype).set_dtype(1, dtype).set_dtype(2, dtype); |
| 262 | if (dtype.enumv() == DTypeEnum::Float16) |
| 263 | checker.set_epsilon(2e-2); |
| 264 | |
| 265 | // simple case |
| 266 | // clang-format off |
| 267 | for (uint32_t s : {1, 2}) |
| 268 | for (uint32_t p : {0, 1, 2, 3}) |
| 269 | for (size_t f : {2, 3, 5, 7}) |
| 270 | for (size_t ocpg : {1, 3}) { |
| 271 | checker.set_param(gconv_param({M, p, p, s, s})) |
| 272 | .execs({{2, 3, 16, 16}, {3, ocpg, 1, f, f}, {}}); |
| 273 | } |
| 274 | // clang-format on |
| 275 | |
| 276 | checker.set_param(gconv_param({M, 2, 3, 2, 1})) |
| 277 | .execs({{32, 12, 20, 10}, {12, 2, 1, 4, 5}, {}}); |
| 278 | |
| 279 | // padding larger than kern |
| 280 | checker.set_param(gconv_param({M, 20, 30, 4, 5})) |
| 281 | .execs({{32, 12, 20, 10}, {12, 2, 1, 4, 5}, {}}); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | TEST_F(CUDA, CHANWISE_CONVOLUTION_FORWARD_SMALL) { |
| 286 | Checker<Convolution> checker(handle_cuda()); |
nothing calls this directly
no test coverage detected