File: spv.bfloat16_error.comp

package info (click to toggle)
glslang 16.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,084 kB
  • sloc: cpp: 90,714; yacc: 4,243; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (74 lines) | stat: -rw-r--r-- 1,484 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#version 450 core

#extension GL_EXT_bfloat16 : require
#extension GL_KHR_cooperative_matrix : enable
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_EXT_shader_explicit_arithmetic_types : enable
#extension GL_EXT_scalar_block_layout : enable

layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

bfloat16_t funcbf16(bfloat16_t x)
{
    return x;
}

void main()
{
    bfloat16_t b;
    uint8_t u8 = uint8_t(5);
    uint16_t u16 = uint16_t(5);
    uint32_t u32 = 5;
    uint64_t u64 = 5;
    int8_t i8 = int8_t(6);
    int16_t i16 = int16_t(6);
    int32_t i32 = 6;
    int64_t i64 = 6;
    bfloat16_t bf16 = bfloat16_t(7);
    float16_t f16 = float16_t(7);
    float32_t f32 = 7;
    float64_t f64 = 7;
    b = (u8);
    b = (u16);
    b = (u32);
    b = (u64);
    b = (i8);
    b = (i16);
    b = (i32);
    b = (i64);
    b = (bf16); // not an error
    b = (f16);
    b = (f32);
    b = (f64);
    u8 = (b);
    u16 = (b);
    u32 = (b);
    u64 = (b);
    i8 = (b);
    i16 = (b);
    i32 = (b);
    i64 = (b);
    bf16 = (b); // not an error
    f16 = (b);
    f32 = (b); // not an error
    f64 = (b); // not an error

    dot(b2, f16vec2(0));

    funcbf16(f16);
    funcbf16(f32);
    funcbf16(f64);

    bool bl = bool(b);
    b = bfloat16_t(bl);

    b++;
    b--;
    -b;

    b+b;

    coopmat<bfloat16_t, gl_ScopeSubgroup, 16, 16, gl_MatrixUseA> cmA;
    cmA+cmA;
}