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

Function puzzle1

examples/gpu_puzzles/key.cpp:51–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49)";
50
51void puzzle1(Context &ctx) {
52 printf("\n\nPuzzle 1\n\n");
53 static constexpr size_t N = 4;
54 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
55 Tensor output = createTensor(ctx, {N}, kf32);
56 Kernel op = createKernel(ctx, {kPuzzle1, N}, Bindings{a, output},
57 /*totalWorkgroups */ {1, 1, 1});
58 showResult<N>(ctx, op, output);
59}
60
61// Puzzle 2 : Zip
62// Implement a kernel that adds together each position of a and b and stores it

Callers 1

mainFunction · 0.70

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected