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

Function puzzle11

examples/gpu_puzzles/key.cpp:482–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480 }
481)";
482void puzzle11(Context &ctx) {
483 printf("\n\nPuzzle 11\n\n");
484 static constexpr size_t N = 6;
485 static constexpr size_t CONV = 3;
486 static constexpr size_t Wx = 8;
487 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
488 Tensor b = createTensor(ctx, {CONV}, kf32, makeData<CONV>().data());
489 Tensor output = createTensor(ctx, {N}, kf32);
490 struct Params {
491 uint32_t size = N;
492 uint32_t TPB = 8;
493 };
494
495 Kernel op =
496 createKernel(ctx, {kPuzzle11, {N, 1, 1}},
497 Bindings{a, b, output}, {Wx, 1, 1}, Params{N});
498 showResult<N>(ctx, op, output);
499}
500
501// Puzzle 12 : Prefix Sum
502// Implement a kernel that computes a sum over a and stores it in out.

Callers 1

mainFunction · 0.70

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected