yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
05cfcc16
main
1#version 450 core 2 3#extension GL_EXT_bfloat16 : require 4#extension GL_EXT_float_e4m3 : 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 11layout ( local_size_x = 1 , local_size_y = 1 , local_size_z = 1 ) in ; 12 13const floate4m3_t bc10 = floate4m3_t ( 10 ) ; 14const fe4m3vec2 b2c20 = fe4m3vec2 ( 20 ) ; 15layout ( constant_id = 1 ) const floate4m3_t bsc10 = floate4m3_t ( 10 ) ; 16 17struct S { floate4m3_t b ; } ; 18const S sc = S ( bc10 ) ; 19 20const floate4m3_t bca [ 2 ] = { bc10 , bc10 } ; 21 22shared floate4m3_t bfs [ 10 ] ; 23 24layout ( scalar ) buffer B { 25fe4m3vec3 b3 ; 26fe4m3vec2 b2 ; 27floate4m3_t b1 ; 28} buf ; 29 30floate4m3_t funcfe4m3 ( floate4m3_t x ) 31{ 32return x ; 33} 34 35floate4m3_t funcf32 ( float32_t x ) 36{ 37return floate4m3_t ( x ) ; 38} 39 40floate4m3_t funcf64 ( float64_t x ) 41{ 42return floate4m3_t ( x ) ; 43} 44 45void main () 46{ 47float f = 2.0 ; 48floate4m3_t b = floate4m3_t ( 1.0 ) ; 49floate4m3_t ( f ) ; 50fe4m3vec2 b2 = fe4m3vec2 ( f ) ; 51 52uint8_t u8 = uint8_t ( 5 ) ; 53uint16_t u16 = uint16_t ( 5 ) ; 54uint32_t u32 = 5 ; 55uint64_t u64 = 5 ; 56int8_t i8 = int8_t ( 6 ) ; 57int16_t i16 = int16_t ( 6 ) ; 58int32_t i32 = 6 ; 59int64_t i64 = 6 ; 60floate4m3_t fe4m3 = floate4m3_t ( 7 ) ; 61float16_t f16 = float16_t ( 7 ) ; 62float32_t f32 = 7 ; 63float64_t f64 = 7 ; 64b = floate4m3_t ( u8 ) ; 65b = floate4m3_t ( u16 ) ; 66b = floate4m3_t ( u32 ) ; 67b = floate4m3_t ( u64 ) ; 68b = floate4m3_t ( i8 ) ; 69b = floate4m3_t ( i16 ) ; 70b = floate4m3_t ( i32 ) ; 71b = floate4m3_t ( i64 ) ; 72b = floate4m3_t ( fe4m3 ) ; 73b = floate4m3_t ( f16 ) ; 74b = floate4m3_t ( f32 ) ; 75b = floate4m3_t ( f64 ) ; 76u8 = uint8_t ( b ) ; 77u16 = uint16_t ( b ) ; 78u32 = uint32_t ( b ) ; 79u64 = uint64_t ( b ) ; 80i8 = int8_t ( b ) ; 81i16 = int16_t ( b ) ; 82i32 = int32_t ( b ) ; 83i64 = int64_t ( b ) ; 84fe4m3 = floate4m3_t ( b ) ; 85f16 = float16_t ( b ) ; 86f32 = float32_t ( b ) ; 87f64 = float64_t ( b ) ; 88 89f16 = b ; 90f32 = b ; 91f64 = b ; 92 93b = buf . b1 ; 94b2 = buf . b2 ; 95fe4m3vec3 b3 = buf . b3 ; 96 97coopmat < floate4m3_t , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > cmA = coopmat < floate4m3_t , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > ( 3.0 ) ; 98 99coopmat < float , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > cmAf = coopmat < float , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > ( cmA ) ; 100 101funcfe4m3 ( b ) ; 102funcf32 ( b ) ; 103funcf64 ( b ) ; 104 105int8_t i8_1 = floate4m3BitsToIntEXT ( b ) ; 106i8vec2 i8_2 = floate4m3BitsToIntEXT ( b2 ) ; 107i8vec3 i8_3 = floate4m3BitsToIntEXT ( fe4m3vec3 ( b2 , b )) ; 108i8vec4 i8_4 = floate4m3BitsToIntEXT ( fe4m3vec4 ( b2 , b2 )) ; 109 110uint8_t u8_1 = floate4m3BitsToUintEXT ( b ) ; 111u8vec2 u8_2 = floate4m3BitsToUintEXT ( b2 ) ; 112u8vec3 u8_3 = floate4m3BitsToUintEXT ( fe4m3vec3 ( b2 , b )) ; 113u8vec4 u8_4 = floate4m3BitsToUintEXT ( fe4m3vec4 ( b2 , b2 )) ; 114 115floate4m3_t f8_1 = intBitsToFloate4m3EXT ( i8_1 ) ; 116fe4m3vec2 f8_2 = intBitsToFloate4m3EXT ( i8_2 ) ; 117fe4m3vec3 f8_3 = intBitsToFloate4m3EXT ( i8_3 ) ; 118fe4m3vec4 f8_4 = intBitsToFloate4m3EXT ( i8_4 ) ; 119 120f8_1 = uintBitsToFloate4m3EXT ( u8_1 ) ; 121f8_2 = uintBitsToFloate4m3EXT ( u8_2 ) ; 122f8_3 = uintBitsToFloate4m3EXT ( u8_3 ) ; 123f8_4 = uintBitsToFloate4m3EXT ( u8_4 ) ; 124} 125 126floate4m3_t func2 ( fe4m3vec4 v [ 2 ] , int i ) 127{ 128floate4m3_t b ; 129b = ( fe4m3vec2 ( v [ 0 ]))[ i ] ; 130b = ( fe4m3vec2 ( v [ 1 ])) . y ; 131 132v [ i ] . z = v [ i ][ i ] ; 133 134S s ; 135s . b = b ; 136 137b = ( i != 0 ) ? b : floate4m3_t ( 2 ) ; 138 139if ( i == 2 ) { 140b = v [ 0 ] . x ; 141} else { 142b = v [ 1 ] . y ; 143} 144 145return b ; 146} 147 148void saturatedconverts () 149{ 150float f = 1.0 ; 151vec2 f2 = vec2 ( f ) ; 152floate4m3_t b ; 153fe4m3vec2 b2 ; 154uint32_t u ; 155int32_t i ; 156saturatedConvertEXT ( b , f ) ; 157saturatedConvertEXT ( b2 , f2 ) ; 158saturatedConvertEXT ( b , u ) ; 159saturatedConvertEXT ( b , i ) ; 160 161coopmat < float16_t , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseAccumulator > matf16C ; 162coopmat < float16_t , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > matf16A ; 163coopmat < floate4m3_t , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > mate4m3A ; 164 165mate4m3A = coopmat < floate4m3_t , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > ( matf16A ) ; 166mate4m3A = coopmat < floate4m3_t , gl_ScopeSubgroup , 16 , 16 , gl_MatrixUseA > ( matf16C ) ; 167saturatedConvertEXT ( mate4m3A , matf16A ) ; 168saturatedConvertEXT ( mate4m3A , matf16C ) ; 169}