summaryrefslogtreecommitdiff
path: root/ggml/src/vulkan-shaders/square.comp
blob: 1fa118c996e04e12f07a67f927f5791464028685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#version 450

#include "types.comp"
#include "generic_unary_head.comp"

void main() {
    const uint idx = get_idx();

    if (idx >= p.ne) {
        return;
    }

    const FLOAT_TYPE val = FLOAT_TYPE(data_a[src0_idx(idx)]);
    data_d[p.d_offset + dst_idx(idx)] = D_TYPE(val * val);
}