From 75c5fd1b66527f869ef3cb56201d995c3bd9e0b9 Mon Sep 17 00:00:00 2001 From: Edward Smyth Date: Wed, 29 Mar 2023 17:51:38 -0400 Subject: [PATCH] Bug fixes in ZSCALV Fixes for a couple of issues: - Modify alpha argument in kernel call in zscal_blis_impl to avoid compiler warning message about discarding 'const' qualifier from pointer target type. - When BLIS_ARCH_TYPE=generic, call to bli_cntx_get_l1v_ker_dt in ref_kernels/1/bli_scalv_ref.c for ZSCAL was causing a segmentation fault. This was because the cntx was NULL on entry to this function. Correct by getting zscal_blis_impl to pass the cntx it has initialized for non-Zen codepaths. This changes has been copied to idamax_blis_impl for consistency. AMD-Internal: [CPUPL-2773] Change-Id: Ib02e4c1a2a7bf30c208732241d4959f7a2696179 --- frame/compat/bla_amax_amd.c | 4 ++-- frame/compat/bla_scal_amd.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frame/compat/bla_amax_amd.c b/frame/compat/bla_amax_amd.c index 926db8841..9b5c7b366 100644 --- a/frame/compat/bla_amax_amd.c +++ b/frame/compat/bla_amax_amd.c @@ -291,7 +291,7 @@ f77_int idamax_blis_impl incx0 = ( inc_t )(*incx); } - cntx_t* cntx; + cntx_t* cntx = NULL; // Query the architecture ID arch_t id = bli_arch_query_id(); @@ -325,7 +325,7 @@ f77_int idamax_blis_impl n0, x0, incx0, &bli_index, - NULL + cntx ); /* diff --git a/frame/compat/bla_scal_amd.c b/frame/compat/bla_scal_amd.c index 65173b647..55faa1659 100644 --- a/frame/compat/bla_scal_amd.c +++ b/frame/compat/bla_scal_amd.c @@ -666,7 +666,7 @@ void zscal_blis_impl // Definition of function pointer zscalv_ker_ft scalv_fun_ptr; - cntx_t* cntx; + cntx_t* cntx = NULL; // Query the architecture ID arch_t id = bli_arch_query_id(); @@ -700,9 +700,9 @@ void zscal_blis_impl ( BLIS_NO_CONJUGATE, n0, - alpha, + (dcomplex*) alpha, x0, incx0, - NULL + cntx ); AOCL_DTL_TRACE_EXIT(AOCL_DTL_LEVEL_TRACE_1)