@@ -598,9 +598,10 @@ const uint[1024] iq1s_grid_const = {
598598 0x55dd55df, 0x55d555d7, 0x5503550c, 0x557f5501, 0x5577557d, 0x55405575, 0x555d555f, 0x55555557
599599};
600600
601+ #if defined(NEEDS_IQ1S_GRID_GPU)
601602// Same content as iq1s_grid_const except each 2-bit value is expanded to 4-bit
602603// and has 1 added to it (allows packed values to be extracted with & 0x0F0F0F0F
603- // and 0xF0F0F0F0).
604+ // and 0xF0F0F0F0). This is only used by the q8_1/int-dot vector path.
604605const uint32_t[2048 ] iq1s_grid_gpu_const = {
605606 0x00000000, 0x00000002, 0x00000101, 0x00000200, 0x00000202, 0x00010001, 0x00010101, 0x00020000,
606607 0x00020002, 0x00020200, 0x00020202, 0x01000101, 0x01010001, 0x01010100, 0x01010102, 0x01020101,
@@ -859,9 +860,12 @@ const uint32_t[2048] iq1s_grid_gpu_const = {
859860 0x20222020, 0x20222022, 0x20222220, 0x20222222, 0x21212021, 0x21212120, 0x21212122, 0x22202020,
860861 0x22202022, 0x22202220, 0x22202222, 0x22212121, 0x22222020, 0x22222022, 0x22222220, 0x22222222,
861862};
863+ #endif
862864
863865shared uint16_t iq1s_grid[2048 ];
866+ #if defined(NEEDS_IQ1S_GRID_GPU)
864867shared uint32_t iq1s_grid_gpu[2048 ];
868+ #endif
865869
866870#define NEEDS_INIT_IQ_SHMEM
867871void init_iq_shmem(uvec3 wgsize)
@@ -875,12 +879,14 @@ void init_iq_shmem(uvec3 wgsize)
875879 iq1s_grid[2 * idx+ 1 ] = g.y;
876880 }
877881 }
882+ #if defined(NEEDS_IQ1S_GRID_GPU)
878883 [[unroll]] for (uint i = 0 ; i < iq1s_grid_gpu_const.length (); i += wgsize.x) {
879884 uint idx = i + gl_LocalInvocationIndex.x;
880885 if (iq1s_grid_gpu_const.length () % wgsize.x == 0 || idx < iq1s_grid_gpu_const.length ()) {
881886 iq1s_grid_gpu[idx] = iq1s_grid_gpu_const[idx];
882887 }
883888 }
889+ #endif
884890 barrier();
885891}
886892#endif
0 commit comments