yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

Einar HovAdd support for bfloat16 and float8 tensors5ed4003a

main
1.5 KiB52 linesraw
1#version 460 core
2
3#extension GL_ARM_tensors : enable
4#extension GL_EXT_shader_explicit_arithmetic_types : enable
5
6#if !defined GL_ARM_tensors
7#  error GL_ARM_tensors is not defined
8#elif GL_ARM_tensors != 1
9#  error GL_ARM_tensors is not equal to 1
10#endif
11
12#if !defined GL_ARM_tensors_bfloat16
13#  error GL_ARM_tensors_bfloat16 is not defined
14#elif GL_ARM_tensors_bfloat16 != 1
15#  error GL_ARM_tensors_bfloat16 is not equal to 1
16#endif
17
18#if !defined GL_ARM_tensors_float_e5m2
19#  error GL_ARM_tensors_float_e5m2 is not defined
20#elif GL_ARM_tensors_float_e5m2 != 1
21#  error GL_ARM_tensors_float_e5m2 is not equal to 1
22#endif
23
24#if !defined GL_ARM_tensors_float_e4m3
25#  error GL_ARM_tensors_float_e4m3 is not defined
26#elif GL_ARM_tensors_float_e4m3 != 1
27#  error GL_ARM_tensors_float_e4m3 is not equal to 1
28#endif
29
30layout(binding = 0) uniform tensorARM<int32_t, 4> t;
31layout(set = 0, binding = 1) uniform tensorARM<bool, 2> tb;
32
33void main()
34{
35    bool b;
36    bool barr[4];
37    int32_t i32;
38    int32_t vec[2];
39    int32_t vecthree[3];
40    int32_t vecfour[4];
41    tensorReadARM(tb, uint[](0, 0), b);
42    tensorReadARM(tb, uint[](0, 0), barr);
43    tensorReadARM(t, uint[](0,0,0,0), i32, gl_TensorOperandsOutOfBoundsValueARM, 33);
44    tensorReadARM(t, uint[](1,2,3,4), vec);
45    tensorReadARM(t, uint[](3,2,1,0), vecthree);
46    tensorReadARM(t, uint[](99,99,99,99), vecfour);
47
48    tensorWriteARM(tb, uint[](0, 0), b);
49    tensorWriteARM(tb, uint[](0, 0), barr);
50    tensorWriteARM(t, uint[](4,3,2,1), i32);
51    tensorWriteARM(t, uint[](0,0,0,0), vec, gl_TensorOperandsNonTemporalARM);
52}