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

Function puzzle7

examples/gpu_puzzles/run.cpp:227–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225 }
226)";
227void puzzle7(Context &ctx) {
228 printf("\n\nPuzzle 7\n\n");
229 static constexpr size_t N = 5;
230 static constexpr size_t Wx = 3;
231 static constexpr size_t Wy = 3;
232 static constexpr size_t Bx = 2;
233 static constexpr size_t By = 2;
234 Tensor a = createTensor(ctx, {N, N}, kf32, makeData<N * N>().data());
235 Tensor output = createTensor(ctx, {N, N}, kf32);
236 struct Params {
237 uint32_t size = N;
238 };
239
240 Kernel op =
241 createKernel(ctx, {kPuzzle7, {Wx, Wy, 1}},
242 Bindings{a, output}, {Bx, By, 1}, Params{N});
243 showResult<N, N, N>(ctx, op, output);
244}
245
246// Puzzle 8 : Shared
247// Implement a kernel that adds 10 to each position of a and stores it in out.

Callers

nothing calls this directly

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected