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

Function puzzle11

examples/gpu_puzzles/run.cpp:379–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377 }
378)";
379void puzzle11(Context &ctx) {
380 printf("\n\nPuzzle 11\n\n");
381 static constexpr size_t N = 6;
382 static constexpr size_t CONV = 3;
383 static constexpr size_t Wx = 8;
384 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
385 Tensor b = createTensor(ctx, {CONV}, kf32, makeData<CONV>().data());
386 Tensor output = createTensor(ctx, {N}, kf32);
387 struct Params {
388 uint32_t size = N;
389 uint32_t TPB = 8;
390 };
391
392 Kernel op =
393 createKernel(ctx, {kPuzzle11, {N, 1, 1}},
394 Bindings{a, b, output}, {Wx, 1, 1}, Params{N});
395 showResult<N>(ctx, op, output);
396}
397
398// Puzzle 12 : Prefix Sum
399// Implement a kernel that computes a sum over a and stores it in out.

Callers

nothing calls this directly

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected