| 174 | } |
| 175 | )"; |
| 176 | void puzzle5(Context &ctx) { |
| 177 | printf("\n\nPuzzle 5\n\n"); |
| 178 | static constexpr size_t N = 2; |
| 179 | static constexpr size_t Wx = 3; |
| 180 | static constexpr size_t Wy = 3; |
| 181 | Tensor a = createTensor(ctx, {N, 1}, kf32, makeData<N>().data()); |
| 182 | Tensor b = createTensor(ctx, {1, N}, kf32, makeData<N>().data()); |
| 183 | Tensor output = createTensor(ctx, {N, N}, kf32); |
| 184 | struct Params { |
| 185 | uint32_t size = N; |
| 186 | }; |
| 187 | |
| 188 | Kernel op = |
| 189 | createKernel(ctx, {kPuzzle5, /*workgroup size*/ {Wx, Wy, 1}}, |
| 190 | Bindings{a, b, output}, {1, 1, 1}, Params{N}); |
| 191 | showResult<N, N, N>(ctx, op, output); |
| 192 | } |
| 193 | |
| 194 | // Puzzle 6 : Blocks |
| 195 | // Implement a kernel that adds 10 to each position of a and stores it in out. |
no test coverage detected