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

Function puzzle10

examples/gpu_puzzles/run.cpp:340–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338 }
339)";
340void puzzle10(Context &ctx) {
341 printf("\n\nPuzzle 10\n\n");
342 static constexpr size_t N = 8;
343 static constexpr size_t Wx = 8;
344 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
345 Tensor b = createTensor(ctx, {N}, kf32, makeData<N>().data());
346 Tensor output = createTensor(ctx, {1}, kf32);
347 struct Params {
348 uint32_t size = N;
349 };
350
351 Kernel op =
352 createKernel(ctx, {kPuzzle10, {Wx, 1, 1}},
353 Bindings{a, b, output}, {1, 1, 1}, Params{N});
354 showResult<1>(ctx, op, output);
355}
356
357// Puzzle 11 : Convolution
358// Implement a kernel that computes a 1D convolution between 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