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

Function puzzle13

examples/gpu_puzzles/run.cpp:457–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456)";
457void puzzle13(Context &ctx) {
458 printf("\n\nPuzzle 13\n\n");
459 static constexpr size_t N = 6;
460 static constexpr size_t TPB = 8;
461 static constexpr size_t BATCH = 4;
462 Tensor a = createTensor(ctx, {BATCH, N}, kf32, makeData<N * BATCH>().data());
463 Tensor output = createTensor(ctx, {BATCH}, kf32);
464 struct Params {
465 uint32_t TPB = TPB;
466 uint32_t size = N;
467 };
468
469 Kernel op =
470 createKernel(ctx, {kPuzzle13, {TPB, 1, 1}},
471 Bindings{a, output}, {1, BATCH, 1}, Params{TPB, N});
472 showResult<BATCH>(ctx, op, output);
473}
474
475// Puzzle 14 : Matrix Multiply!!
476// Implement a kernel that computes the matrix 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