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

Function puzzle13

examples/gpu_puzzles/key.cpp:611–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610)";
611void puzzle13(Context &ctx) {
612 printf("\n\nPuzzle 13\n\n");
613 static constexpr size_t N = 6;
614 static constexpr size_t TPB = 8;
615 static constexpr size_t BATCH = 4;
616 Tensor a = createTensor(ctx, {BATCH, N}, kf32, makeData<N * BATCH>().data());
617 Tensor output = createTensor(ctx, {BATCH}, kf32);
618 struct Params {
619 uint32_t TPB = TPB;
620 uint32_t size = N;
621 };
622
623 Kernel op =
624 createKernel(ctx, {kPuzzle13, {TPB, 1, 1}},
625 Bindings{a, output}, {1, BATCH, 1}, Params{TPB, N});
626 showResult<BATCH>(ctx, op, output);
627}
628
629// Puzzle 14 : Matrix Multiply!!
630// Implement a kernel that computes the matrix 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