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

Function puzzle10

examples/gpu_puzzles/key.cpp:413–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411 }
412)";
413void puzzle10(Context &ctx) {
414 printf("\n\nPuzzle 10\n\n");
415 static constexpr size_t N = 8;
416 static constexpr size_t Wx = 8;
417 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
418 Tensor b = createTensor(ctx, {N}, kf32, makeData<N>().data());
419 Tensor output = createTensor(ctx, {1}, kf32);
420 struct Params {
421 uint32_t size = N;
422 };
423
424 Kernel op =
425 createKernel(ctx, {kPuzzle10, {Wx, 1, 1}},
426 Bindings{a, b, output}, {1, 1, 1}, Params{N});
427 showResult<1>(ctx, op, output);
428}
429
430// Puzzle 11 : Convolution
431// Implement a kernel that computes a 1D convolution between 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