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

Function puzzle8

examples/gpu_puzzles/run.cpp:267–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265 }
266)";
267void puzzle8(Context &ctx) {
268 printf("\n\nPuzzle 8\n\n");
269 static constexpr size_t N = 8;
270 static constexpr size_t Wx = 4;
271 static constexpr size_t Bx = 2;
272 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
273 Tensor output = createTensor(ctx, {N}, kf32);
274 struct Params {
275 uint32_t size = N;
276 uint32_t TPB = 8;
277 };
278
279 Kernel op =
280 createKernel(ctx, {kPuzzle8, {Wx, 1, 1}},
281 Bindings{a, output}, {Bx, 1, 1}, Params{N, 8});
282 showResult<N>(ctx, op, output);
283}
284
285// Puzzle 9 : Pooling
286// Implement a kernel that sums together the last 3 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