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

Function puzzle9

examples/gpu_puzzles/run.cpp:304–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302 }
303)";
304void puzzle9(Context &ctx) {
305 printf("\n\nPuzzle 9\n\n");
306 static constexpr size_t N = 8;
307 static constexpr size_t Wx = 8;
308 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
309 Tensor output = createTensor(ctx, {N}, kf32);
310 struct Params {
311 uint32_t size = N;
312 };
313
314 Kernel op =
315 createKernel(ctx, {kPuzzle9, {Wx, 1, 1}},
316 Bindings{a, output}, {1, 1, 1}, Params{N});
317 showResult<N>(ctx, op, output);
318}
319
320// Puzzle 10 : Dot Product
321// Implement a kernel that computes the dot-product of a and b and stores it in out.

Callers

nothing calls this directly

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected