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

Function puzzle9

examples/gpu_puzzles/key.cpp:362–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360 }
361)";
362void puzzle9(Context &ctx) {
363 printf("\n\nPuzzle 9\n\n");
364 static constexpr size_t N = 8;
365 static constexpr size_t Wx = 8;
366 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
367 Tensor output = createTensor(ctx, {N}, kf32);
368 struct Params {
369 uint32_t size = N;
370 };
371
372 Kernel op =
373 createKernel(ctx, {kPuzzle9, {Wx, 1, 1}},
374 Bindings{a, output}, {1, 1, 1}, Params{N});
375 showResult<N>(ctx, op, output);
376}
377
378// Puzzle 10 : Dot Product
379// Implement a kernel that computes the dot-product of a and b and stores it in out.

Callers 1

mainFunction · 0.70

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected