llama-cpp-turboquant/examples/array_multiplication/shader/my_shader.comp
Fabian Sauter 7d16b73d14 Updated the array_multiplication example
Signed-off-by: Fabian Sauter <sauter.fabian@mailbox.org>
2022-07-27 12:48:46 +02:00

14 lines
No EOL
356 B
Text

#version 450
// The execution structure
layout (local_size_x = 1) in;
// The buffers are provided via the tensors
layout(binding = 0) buffer bufA { float a[]; };
layout(binding = 1) buffer bufB { float b[]; };
layout(binding = 2) buffer bufOut { float o[]; };
void main() {
uint index = gl_GlobalInvocationID.x;
o[index] = a[index] * b[index];
}