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

Function puzzle2

examples/gpu_puzzles/run.cpp:72–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70)";
71
72void puzzle2(Context &ctx) {
73 printf("\n\nPuzzle 2\n\n");
74 static constexpr size_t N = 4;
75 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
76 Tensor b = createTensor(ctx, {N}, kf32, makeData<N>().data());
77 Tensor output = createTensor(ctx, {N}, kf32);
78 Kernel op = createKernel(ctx, {kPuzzle2, N}, Bindings{a, b, output},
79 {1, 1, 1});
80 showResult<N>(ctx, op, output);
81}
82
83// Puzzle 3 : Guards
84// Implement a kernel that adds 10 to each position of 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