AOCL progress callback hardening

- BLIS uses callback function to report the progress of the
  operation. The callback is implemented in the user application
  and is invoked by BLIS.

- Updated callback function prototype to make all arguments const.
  This will ensure that any attempt to write using callback’s
  argument is prevented at the compile time itself.

AMD-Internal: [CPUPL-2504]
Change-Id: I8ceb671242365d2a9155b485301cd8c75043e667
This commit is contained in:
Dipal M Zambare
2022-09-07 13:33:51 +05:30
parent 9bc59cc500
commit 61232d540c
3 changed files with 16 additions and 16 deletions

View File

@@ -37,11 +37,11 @@
// Public interface for the end user.
typedef dim_t (*AOCL_progress_callback)(char *api,
dim_t lapi,
dim_t progress,
dim_t current_thread,
dim_t total_threads);
typedef dim_t (*AOCL_progress_callback)(const char* const api,
const dim_t lapi,
const dim_t progress,
const dim_t current_thread,
const dim_t total_threads);
BLIS_EXPORT_BLIS void AOCL_BLIS_set_progress(AOCL_progress_callback func);

View File

@@ -48,14 +48,14 @@
//#define CBLAS
// Uncomment to enable progress printing.
//#define PROGRESS_ENABLED
#define PROGRESS_ENABLED
#ifdef PROGRESS_ENABLED
dim_t AOCL_progress(char *api,
dim_t lapi,
dim_t progress,
dim_t current_thread,
dim_t total_threads)
dim_t AOCL_progress( const char* const api,
const dim_t lapi,
const dim_t progress,
const dim_t current_thread,
const dim_t total_threads )
{
printf("\n%s, len = %ld, nt = %ld, tid = %ld, Processed %ld Elements",
api, lapi, total_threads, current_thread, progress);

View File

@@ -54,11 +54,11 @@
//#define PROGRESS_ENABLED
#ifdef PROGRESS_ENABLED
dim_t AOCL_progress(char *api,
dim_t lapi,
dim_t progress,
dim_t current_thread,
dim_t total_threads)
dim_t AOCL_progress( const char* const api,
const dim_t lapi,
const dim_t progress,
const dim_t current_thread,
const dim_t total_threads )
{
printf("\n%s, len = %ld, nt = %ld, tid = %ld, Processed %ld Elements",
api, lapi, total_threads, current_thread, progress);