| 306 | } |
| 307 | )"; |
| 308 | void puzzle8(Context &ctx) { |
| 309 | printf("\n\nPuzzle 8\n\n"); |
| 310 | static constexpr size_t N = 8; |
| 311 | static constexpr size_t Wx = 4; |
| 312 | static constexpr size_t Bx = 2; |
| 313 | Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data()); |
| 314 | Tensor output = createTensor(ctx, {N}, kf32); |
| 315 | struct Params { |
| 316 | uint32_t size = N; |
| 317 | uint32_t TPB = 8; |
| 318 | }; |
| 319 | |
| 320 | Kernel op = |
| 321 | createKernel(ctx, {kPuzzle8, {Wx, 1, 1}}, |
| 322 | Bindings{a, output}, {Bx, 1, 1}, Params{N, 8}); |
| 323 | showResult<N>(ctx, op, output); |
| 324 | } |
| 325 | |
| 326 | // Puzzle 9 : Pooling |
| 327 | // Implement a kernel that sums together the last 3 position of a and stores it in out. |
no test coverage detected