| 135 | } |
| 136 | )"; |
| 137 | void puzzle4(Context &ctx) { |
| 138 | printf("\n\nPuzzle 4\n\n"); |
| 139 | static constexpr size_t Wx = 3; |
| 140 | static constexpr size_t Wy = 3; |
| 141 | static constexpr size_t N = 2; |
| 142 | Tensor input = createTensor(ctx, {N, N}, kf32, makeData<N * N>().data()); |
| 143 | Tensor output = createTensor(ctx, {N, N}, kf32); |
| 144 | struct Params { |
| 145 | uint32_t size = N; |
| 146 | }; |
| 147 | Kernel op = |
| 148 | createKernel(ctx, {kPuzzle4, /*workgroup size*/ {Wx, Wy, 1}}, |
| 149 | Bindings{input, output}, /* totalWorkgroups */ {1, 1, 1}, Params{N}); |
| 150 | showResult<N, N, N>(ctx, op, output); |
| 151 | } |
| 152 | |
| 153 | // Puzzle 5 : Broadcast |
| 154 | // Implement a kernel that adds a and b and stores it in out. Inputs a and b |
no test coverage detected