MCPcopy Create free account
hub / github.com/AnswerDotAI/gpu.cpp / puzzle6

Function puzzle6

examples/gpu_puzzles/key.cpp:216–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 }
215)";
216void puzzle6(Context &ctx) {
217 printf("\n\nPuzzle 6\n\n");
218 static constexpr size_t N = 9;
219 static constexpr size_t Wx = 4;
220 static constexpr size_t Bx = 3;
221 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
222 Tensor output = createTensor(ctx, {N}, kf32);
223 struct Params {
224 uint32_t size = N;
225 };
226
227 Kernel op =
228 createKernel(ctx, {kPuzzle6, {Wx, 1, 1}},
229 Bindings{a, output}, {Bx, 1, 1}, Params{N});
230 showResult<N>(ctx, op, output);
231}
232
233// Puzzle 7 : Blocks 2D
234// Implement the same kernel in 2D.

Callers 1

mainFunction · 0.70

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected