yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
8dd7112d
16.4.0
1#version 450 core 2#extension GL_KHR_memory_scope_semantics : enable 3#extension GL_KHR_cooperative_matrix : enable 4#extension GL_EXT_shader_explicit_arithmetic_types : enable 5#extension GL_EXT_buffer_reference : enable 6 7layout ( constant_id = 0 ) const int M = 3 ; 8layout ( constant_id = 1 ) const int N = 3 ; 9 10layout ( local_size_x = 4 , local_size_y = 1 , local_size_z = 1 ) in ; 11 12layout ( set = 0 , binding = 0 ) coherent buffer Block16 { 13float16_t x [] ; 14} block ; 15 16void main () { 17coopmat < float16_t , gl_ScopeSubgroup , 3 , 4 , gl_MatrixUseA > a ; 18coopmat < float16_t , gl_ScopeSubgroup , 3 , 4 , gl_MatrixUseB > b ; 19coopMatLoad ( a , block . x , 0 , 3 , gl_CooperativeMatrixLayoutRowMajor ) ; 20coopMatLoad ( b , block . x , 0 , 3 , gl_CooperativeMatrixLayoutRowMajor ) ; 21 22coopmat < float16_t , gl_ScopeSubgroup , 3 , 3 , gl_MatrixUseAccumulator > c = 23coopmat < float16_t , gl_ScopeSubgroup , 3 , 3 , gl_MatrixUseAccumulator > ( 1.0 ) ; 24 25// Incompatible dimensions (inside doesn't match): (3, 4) x (3, 4) 26c = coopMatMulAdd ( a , b , c ) ; 27 28coopmat < float16_t , gl_ScopeSubgroup , M , N , gl_MatrixUseA > i ; 29coopmat < float16_t , gl_ScopeSubgroup , M , N , gl_MatrixUseB > j ; 30coopMatLoad ( a , block . x , 0 , M , gl_CooperativeMatrixLayoutRowMajor ) ; 31coopMatLoad ( b , block . x , 0 , M , gl_CooperativeMatrixLayoutRowMajor ) ; 32 33coopmat < float16_t , gl_ScopeSubgroup , M , N , gl_MatrixUseAccumulator > k = 34coopmat < float16_t , gl_ScopeSubgroup , M , N , gl_MatrixUseAccumulator > ( 2.0 ) ; 35 36// Incompatible dimensions (inside doesn't match): (M, N) x (M, N) 37k = coopMatMulAdd ( i , j , k ) ; 38 39coopmat < float16_t , gl_ScopeSubgroup , 4 , 3 , gl_MatrixUseB > d ; 40coopMatLoad ( d , block . x , 0 , 4 , gl_CooperativeMatrixLayoutRowMajor ) ; 41coopmat < float16_t , gl_ScopeSubgroup , 4 , 4 , gl_MatrixUseAccumulator > e = 42coopmat < float16_t , gl_ScopeSubgroup , 4 , 4 , gl_MatrixUseAccumulator > ( 3.0 ) ; 43 44// Incompatible dimensions (product doesn't match sum): (3, 4) * (4, 3) = (3, 3) + (4, 4) 45e = coopMatMulAdd ( a , d , e ) ; 46 47// Improper usage type: A 48coopmat < float16_t , gl_ScopeSubgroup , 3 , 4 , gl_MatrixUseB > f ; 49coopMatLoad ( f , block . x , 0 , 3 , gl_CooperativeMatrixLayoutRowMajor ) ; 50c = coopMatMulAdd ( f , d , c ) ; 51 52// Improper usage type: B 53coopmat < float16_t , gl_ScopeSubgroup , 4 , 3 , gl_MatrixUseAccumulator > g ; 54coopMatLoad ( g , block . x , 0 , 4 , gl_CooperativeMatrixLayoutRowMajor ) ; 55c = coopMatMulAdd ( a , g , c ) ; 56 57// Improper usage type: Accum 58coopmat < float16_t , gl_ScopeSubgroup , 3 , 3 , gl_MatrixUseA > h = 59coopmat < float16_t , gl_ScopeSubgroup , 3 , 3 , gl_MatrixUseA > ( 1.0 ) ; 60e = coopMatMulAdd ( a , d , h ) ; 61}