mirror of
https://github.com/amd/blis.git
synced 2026-04-19 23:28:52 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user