Fixed few Coverity warnings in aocl gemm addon

Fixed few Coverity warnings in aocl gemm addon 


AMD-Internal: CPUPL-6913
This commit is contained in:
Bhaskar, Nallani
2025-08-06 15:37:40 +05:30
committed by GitHub
parent efdb5a06df
commit 9d571bb5d3
4 changed files with 23 additions and 3 deletions

View File

@@ -445,7 +445,6 @@ LPGEMM_5LOOP_AVX512BF16(bfloat16,bfloat16,float,bf16bf16f32of32)
{
c_use_jc = c + jc;
}
// Temp accumulaton buffer for C allocation.
else if ( c_downscale < F32 )
{
// Buffer memory is only required if output needs to be
@@ -466,6 +465,11 @@ LPGEMM_5LOOP_AVX512BF16(bfloat16,bfloat16,float,bf16bf16f32of32)
temp_scal_c_buffer_bf16 = bli_mem_buffer( &mem_scale_c );
c_use_jc = ( float* )temp_scal_c_buffer_bf16;
}else
{
// When k <= KC, output is written directly as there is no need of
// intermediate buffer to store the output
c_use_jc = c + jc;
}
// The temp c buffer stride is modified as opposed to original C matrix.
@@ -1257,6 +1261,11 @@ LPGEMM_5LOOP_AVX2(bfloat16,bfloat16,float,bf16bf16f32of32)
temp_scal_c_buffer_bf16 = bli_mem_buffer( &mem_scale_c );
c_use_jc = ( float* )temp_scal_c_buffer_bf16;
}else
{
// When k <= KC, output is written directly as there is no need of
// intermediate buffer to store the output
c_use_jc = c + jc;
}
// The temp c buffer stride is modified as opposed to original C matrix.

View File

@@ -182,12 +182,12 @@ LPGEMM_TINY(bfloat16,bfloat16,float,bf16bf16f32of32)
dim_t NR = lcntx->blksz.NR;
const int16_t* a_use = NULL;
const int16_t* a_use = a;
dim_t cs_a_use = cs_a;
dim_t rs_a_use = rs_a;
dim_t a_block_stride = 0;
const int16_t* b_use = NULL;
const int16_t* b_use = b;
dim_t rs_b_use = rs_b;
dim_t cs_b_use = cs_b;

View File

@@ -510,6 +510,11 @@ LPGEMM_5LOOP(int8_t,int8_t,int32_t,s8s8s32o32)
temp_scal_c_buffer_s8s8s32o32 = bli_mem_buffer( &mem_scale_c );
c_use_jc = ( int32_t* )temp_scal_c_buffer_s8s8s32o32;
}else
{
// When k <= KC, output is written directly as there is no need of
// intermediate buffer to store the output
c_use_jc = c + jc;
}
// The temp c buffer stride is modified as opposed to original C matrix.

View File

@@ -469,6 +469,12 @@ LPGEMM_5LOOP(uint8_t,int8_t,int32_t,u8s8s32o32)
c_use_jc = ( int32_t* )temp_scal_c_buffer_u8s8s32o32;
}
else
{
// When k <= KC, output is written directly as there is no need of
// intermediate buffer to store the output
c_use_jc = c + jc;
}
// The temp c buffer stride is modified as opposed to original C matrix.
rs_c_use = nc0;