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

Function testAttention

experimental/legacy/transformer/test_kernels.cpp:258–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258void testAttention(Context &ctx) {
259 static constexpr size_t B = 6;
260 static constexpr size_t T = 32; // token index
261 static constexpr size_t C = 3072; // input channels
262 static constexpr size_t QKV_DIM = 256;
263 static constexpr size_t N_HEADS = 12;
264 static constexpr size_t OC =
265 QKV_DIM * N_HEADS * 3; // output channels, 3 for Q, K, V
266 std::array<float, B * T * C> inputArr;
267 std::array<float, B * OC> outputArr;
268 std::array<float, C * OC> weightArr;
269}
270
271int main(int argc, char **argv) {
272 Context ctx = createContext();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected