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

Function puzzle8

examples/gpu_puzzles/key.cpp:308–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306 }
307)";
308void 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.

Callers 1

mainFunction · 0.70

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected