yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
09cfe5ce
main
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_NV_cooperative_matrix2 : enable 6#extension GL_EXT_buffer_reference : enable 7 8layout ( local_size_x = 64 , local_size_y = 1 , local_size_z = 1 ) in ; 9 10buffer BufType { 11float16_t arr [ 256 ][ 256 ] ; 12float16_t x [] ; 13} Buf ; 14 15layout ( buffer_reference , std430 , buffer_reference_align = 2 ) buffer fp16Buf { 16float16_t f ; 17} ; 18 19 20float16_t decode ( const in fp16Buf b , const in uint32_t blockCoords [ 2 ] , const in uint32_t coordInBlock [ 2 ]) 21{ 22return b . f ; 23} 24 25struct S { 26f16vec2 x ; 27} ; 28 29 30layout ( std430 , binding = 0 ) buffer SBuf { 31S s [] ; 32} sbuf ; 33 34layout ( constant_id = 0 ) const uint32_t Clamp = gl_CooperativeMatrixClampModeConstantNV ; 35layout ( constant_id = 1 ) const int32_t Clamp_signed = gl_CooperativeMatrixClampModeConstantNV ; 36 37void main () 38{ 39coopmat < float16_t , gl_ScopeWorkgroup , 64 , 32 , gl_MatrixUseA > A ; 40 41tensorLayoutNV < 2 > t = createTensorLayoutNV ( 2 ) ; 42tensorLayoutNV < 3 , 1 > t2 = createTensorLayoutNV ( 3 , 1 ) ; 43 44t = setTensorLayoutBlockSizeNV ( t , 4 , 8 ) ; 45t = setTensorLayoutDimensionNV ( t , 256 , 512 ) ; 46t = sliceTensorLayoutNV ( t , 128 , 32 , 256 , 32 ) ; 47 48tensorViewNV < 5 > v = createTensorViewNV ( 5 ) ; 49v = setTensorViewDimensionsNV ( v , 10 , 11 , 12 , 13 , 14 ) ; 50v = setTensorViewStrideNV ( v , 10 , 11 , 12 , 13 , 15 ) ; 51v = setTensorViewClipNV ( v , 0 , 16 , 0 , 16 ) ; 52 53tensorViewNV < 5 , true > v2 = createTensorViewNV ( 5 , true ) ; 54tensorViewNV < 2 , true , 1 , 0 > v3 = createTensorViewNV ( 2 , true , 1 , 0 ) ; 55 56coopMatLoadTensorNV ( A , Buf . x , 0 , t ) ; 57coopMatStoreTensorNV ( A , Buf . x , 0 , t ) ; 58 59coopMatLoadTensorNV ( A , Buf . x , 0 , t , v ) ; 60coopMatStoreTensorNV ( A , Buf . x , 0 , t , v ) ; 61 62coopMatLoadTensorNV ( A , Buf . x , 0 , t , decode ) ; 63coopMatLoadTensorNV ( A , Buf . x , 0 , t , v , decode ) ; 64 65coopMatLoadTensorNV ( A , sbuf . s , 1 , t , v , decode ) ; 66 67tensorLayoutNV < 2 , Clamp > tc = createTensorLayoutNV ( 2 , Clamp ) ; 68 69coopmat < float16_t , gl_ScopeWorkgroup , 64 , 32 , gl_MatrixUseA > Arr [ 2 ] ; 70coopMatLoadTensorNV ( Arr [ 1 ] , Buf . x , 0 , t ) ; 71 72coopMatLoadTensorNV ( A , Buf . arr [ 8 ] , 0 , t ) ; 73coopMatStoreTensorNV ( A , Buf . arr [ 16 ] , 0 , t ) ; 74 75tensorLayoutNV < 2 , Clamp_signed > tc_s = createTensorLayoutNV ( 2 , Clamp_signed ) ; 76tensorViewNV < Clamp , true > v4 = createTensorViewNV ( Clamp , true ) ; 77tensorLayoutNV < Clamp > tc2 = createTensorLayoutNV ( Clamp ) ; 78tensorViewNV < Clamp > v5 = createTensorViewNV ( Clamp ) ; 79}