void r_1024_1024_4096_4_4(float* restrict data0, const float* restrict data1, const float* restrict data2) {
for (int ridx0 = 0; ridx0 < 1024; ridx0++) {
int alu0 = (ridx0*16384);
for (int ridx1 = 0; ridx1 < 1024; ridx1++) {
int alu1 = (ridx1*4);
int alu2 = (alu0+alu1);
float4 acc0 = make_float4(0.0f,0.0f,0.0f,0.0f);
float4 acc1 = make_float4(0.0f,0.0f,0.0f,0.0f);
float4 acc2 = make_float4(0.0f,0.0f,0.0f,0.0f);
float4 acc3 = make_float4(0.0f,0.0f,0.0f,0.0f);
for (int ridx2 = 0; ridx2 < 4096; ridx2++) {
int alu3 = (alu0+ridx2);
float4 val0 = *((float4*)(data2+alu1+(ridx2*4096)));
float val1 = data1[alu3+4096];
float val2 = data1[alu3+8192];
float val3 = data1[alu3+12288];
float val4 = data1[alu3];
float16 wmma0 = __WMMA_4_4_4_float_float(make_float4(val4,val1,val2,val3), val0,
make_float16(0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f));
acc0 = make_float4((acc0.x+wmma0[0]),(acc0.y+wmma0[1]),(acc0.z+wmma0[2]),(acc0.w+wmma0[3]));
acc1 = make_float4((acc1.x+wmma0[4]),(acc1.y+wmma0[5]),(acc1.z+wmma0[6]),(acc1.w+wmma0[7]));
acc2 = make_float4((acc2.x+wmma0[8]),(acc2.y+wmma0[9]),(acc2.z+wmma0[10]),(acc2.w+wmma0[11]));
acc3 = make_float4((acc3.x+wmma0[12]),(acc3.y+wmma0[13]),(acc3.z+wmma0[14]),(acc3.w+wmma0[15]));
}
float alu4 = ((acc0.x>0.0f)?acc0.x:0.0f);
float alu5 = ((acc1.x>0.0f)?acc1.x:0.0f);
float alu6 = ((acc2.x>0.0f)?acc2.x:0.0f);
float alu7 = ((acc3.x>0.0f)?acc3.x:0.0f);
float alu8 = ((acc0.y>0.0f)?acc0.y:0.0f);
float alu9 = ((acc1.y>0.0f)?acc1.y:0.0f);
float alu10 = ((acc2.y>0.0f)?acc2.y:0.0f);
float alu11 = ((acc3.y>0.0f)?acc3.y:0.0f);
float alu12 = ((acc0.z>0.0f)?acc0.z:0.0f);
float alu13 = ((acc1.z>0.0f)?acc1.z:0.0f);
float alu14 = ((acc2.z>0.0f)?acc2.z:0.0f);
float alu15 = ((acc3.z>0.0f)?acc3.z:0.0f);
float alu16 = ((acc0.w>0.0f)?acc0.w:0.0f);
*((float4*)(data0+alu2)) = make_float4(alu4,alu8,alu12,alu16);
float alu17 = ((acc1.w>0.0f)?acc1.w:0.0f);
*((float4*)(data0+4096+alu2)) = make_float4(alu5,alu9,alu13,alu17);
float alu18 = ((acc2.w>0.0f)?acc2.w:0.0f);
*((float4*)(data0+8192+alu2)) = make_float4(alu6,alu10,alu14,alu18);
float alu19 = ((acc3.w>0.0f)?acc3.w:0.0f);
*((float4*)(data0+12288+alu2)) = make_float4(alu7,alu11,alu15,alu19);
}
}
}
void r_1024_1024_4096_4_4(float* restrict data0, const float* restrict data1, const float* restrict data2) {
for (int ridx0 = 0; ridx0 < 1024; ridx0++) {
int alu0 = (ridx0*16384);
for (int ridx1 = 0; ridx1 < 1024; ridx1++) {
int alu1 = (ridx1*4);
int alu2 = (alu0+alu1);
float4 acc0 = make_float4(0.0f,0.0f,0.0f,0.0f);
float4 acc1 = make_float4(0.0f,0.0f,0.0f,0.0f);
float4 acc2 = make_float4(0.0f,0.0f,0.0f,0.0f);
float4 acc3 = make_float4(0.0f,0.0f,0.0f,0.0f);
AMX_SET(1);
for (int ridx2 = 0; ridx2 < 4096; ridx2++) {
int alu3 = (alu0+ridx2);
float4 val0 = *((float4*)(data2+alu1+(ridx2*4096)));
float val1 = data1[alu3+4096];
float val2 = data1[alu3+8192];
float val3 = data1[alu3+12288];
float val4 = data1[alu3];
__WMMA_4_4_4_float_float(make_float4(val4,val1,val2,val3), val0);
__ST_float32(&acc0, 0);
__ST_float32(&acc1, 1);
__ST_float32(&acc2, 2);
__ST_float32(&acc3, 3);
}
AMX_SET(0);
float alu4 = ((acc0.x>0.0f)?acc0.x:0.0f);
float alu5 = ((acc1.x>0.0f)?acc1.x:0.0f);
float alu6 = ((acc2.x>0.0f)?acc2.x:0.0f);
float alu7 = ((acc3.x>0.0f)?acc3.x:0.0f);
float alu8 = ((acc0.y>0.0f)?acc0.y:0.0f);
float alu9 = ((acc1.y>0.0f)?acc1.y:0.0f);
float alu10 = ((acc2.y>0.0f)?acc2.y:0.0f);
float alu11 = ((acc3.y>0.0f)?acc3.y:0.0f);
float alu12 = ((acc0.z>0.0f)?acc0.z:0.0f);
float alu13 = ((acc1.z>0.0f)?acc1.z:0.0f);
float alu14 = ((acc2.z>0.0f)?acc2.z:0.0f);
float alu15 = ((acc3.z>0.0f)?acc3.z:0.0f);
float alu16 = ((acc0.w>0.0f)?acc0.w:0.0f);
*((float4*)(data0+alu2)) = make_float4(alu4,alu8,alu12,alu16);
float alu17 = ((acc1.w>0.0f)?acc1.w:0.0f);
*((float4*)(data0+4096+alu2)) = make_float4(alu5,alu9,alu13,alu17);
float alu18 = ((acc2.w>0.0f)?acc2.w:0.0f);
*((float4*)(data0+8192+alu2)) = make_float4(alu6,alu10,alu14,alu18);
float alu19 = ((acc3.w>0.0f)?acc3.w:0.0f);
*((float4*)(data0+12288+alu2)) = make_float4(alu7,alu11,alu15,alu19);
}
}
}