yum-mirror/glslang

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

Jeff BolzImplement GL_EXT_ocp_microscaling_types62f5430e

main
2.3 KiB77 linesraw
1#version 450 core
2
3#extension GL_EXT_bfloat16 : require
4#extension GL_EXT_float_ue8m0 : require
5#extension GL_KHR_cooperative_matrix : enable
6#extension GL_NV_cooperative_matrix2 : enable
7#extension GL_KHR_memory_scope_semantics : enable
8#extension GL_EXT_shader_explicit_arithmetic_types : enable
9#extension GL_EXT_scalar_block_layout : enable
10#extension GL_EXT_long_vector : enable
11
12layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
13
14const floatue8m0_t bc10 = floatue8m0_t(10);
15const fue8m0vec2 b2c20 = fue8m0vec2(20);
16layout(constant_id = 1) const floatue8m0_t bsc10 = floatue8m0_t(10);
17
18struct S { floatue8m0_t b; };
19const S sc = S(bc10);
20
21const floatue8m0_t bca[2] = {bc10, bc10};
22
23shared floatue8m0_t bfs[10];
24
25layout(scalar) buffer B {
26    fue8m0vec3 b3;
27    fue8m0vec2 b2;
28    floatue8m0_t b1;
29} buf;
30
31floatue8m0_t funcfue8m0(floatue8m0_t x)
32{
33    return x;
34}
35
36void main()
37{
38    float f = 2.0;
39    floatue8m0_t b = floatue8m0_t(1.0fue8m0);
40
41    float16_t f16 = float16_t(7);
42    float32_t f32 = 7;
43    float64_t f64 = 7;
44    f16 = float16_t(b);
45    f32 = float32_t(b);
46    f64 = float64_t(b);
47
48    b = funcfue8m0(b);
49
50    b = buf.b1;
51    fue8m0vec2 b2 = buf.b2;
52    fue8m0vec3 b3 = buf.b3;
53
54    int8_t i8_1 = floatue8m0BitsToIntEXT(b);
55    i8vec2 i8_2 = floatue8m0BitsToIntEXT(b2);
56    i8vec3 i8_3 = floatue8m0BitsToIntEXT(fue8m0vec3(b2, b));
57    i8vec4 i8_4 = floatue8m0BitsToIntEXT(fue8m0vec4(b2, b2));
58    vector<int8_t, 5> i8_5 = floatue8m0BitsToIntEXT(vector<floatue8m0_t, 5>(b2, b2, b));
59
60    uint8_t u8_1 = floatue8m0BitsToUintEXT(b);
61    u8vec2  u8_2 = floatue8m0BitsToUintEXT(b2);
62    u8vec3  u8_3 = floatue8m0BitsToUintEXT(fue8m0vec3(b2, b));
63    u8vec4  u8_4 = floatue8m0BitsToUintEXT(fue8m0vec4(b2, b2));
64    vector<uint8_t, 5> u8_5 = floatue8m0BitsToUintEXT(vector<floatue8m0_t, 5>(b2, b2, b));
65
66    floatue8m0_t f8_1 = intBitsToFloatue8m0EXT(i8_1);
67    fue8m0vec2   f8_2 = intBitsToFloatue8m0EXT(i8_2);
68    fue8m0vec3   f8_3 = intBitsToFloatue8m0EXT(i8_3);
69    fue8m0vec4   f8_4 = intBitsToFloatue8m0EXT(i8_4);
70    vector<floatue8m0_t, 5> f8_5 = intBitsToFloatue8m0EXT(i8_5);
71
72    f8_1 = uintBitsToFloatue8m0EXT(u8_1);
73    f8_2 = uintBitsToFloatue8m0EXT(u8_2);
74    f8_3 = uintBitsToFloatue8m0EXT(u8_3);
75    f8_4 = uintBitsToFloatue8m0EXT(u8_4);
76    f8_5 = uintBitsToFloatue8m0EXT(u8_5);
77}