forked from flame/blis
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for logging gemm input values.
Added BLIS specific extension to AOCL DTL, in this added support to print the input matrix sizes from BLIS library. AMD Internal: [CPUPL-806] Change-Id: I80ed779d65f9b1c48466137fc2f05629fa2fb561
- Loading branch information
Showing
12 changed files
with
137 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*=================================================================== | ||
* File Name : aocldtl_blis.c | ||
* | ||
* Description : BLIS library specific debug helpes. | ||
* | ||
* Copyright (C) 2020, Advanced Micro Devices, Inc | ||
* | ||
*==================================================================*/ | ||
|
||
|
||
#include "blis.h" | ||
|
||
#if AOCL_DTL_LOG_ENABLE | ||
void AOCL_DTL_log_gemm_sizes(int8 loglevel, | ||
obj_t* alpha, | ||
obj_t* a, | ||
obj_t* b, | ||
obj_t* beta, | ||
obj_t* c, | ||
const char* filename, | ||
const char* function_name, | ||
int line) | ||
{ | ||
char buffer[256]; | ||
gint_t m = bli_obj_length( c ); | ||
gint_t n = bli_obj_width( c ); | ||
gint_t k = bli_obj_length( b ); | ||
guint_t csa = bli_obj_col_stride( a ); | ||
guint_t csb = bli_obj_col_stride( b ); | ||
guint_t csc = bli_obj_col_stride( c ); | ||
guint_t rsa = bli_obj_row_stride( a ); | ||
guint_t rsb = bli_obj_row_stride( b ); | ||
guint_t rsc = bli_obj_row_stride( c ); | ||
const num_t dt_exec = bli_obj_dt( c ); | ||
float* alpha_cast = bli_obj_buffer_for_1x1( dt_exec, alpha ); | ||
float* beta_cast = bli_obj_buffer_for_1x1( dt_exec, beta ); | ||
|
||
sprintf(buffer, "%ld %ld %ld %lu %lu %lu %lu %lu %lu %f %f", | ||
m, k, n, | ||
csa, csb, csc, | ||
rsa, rsb, rsc, | ||
*alpha_cast, *beta_cast); | ||
|
||
DTL_Trace(loglevel, TRACE_TYPE_LOG, function_name, function_name, line, buffer); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*=================================================================== | ||
* File Name : aocldtl_blis.h | ||
* | ||
* Description : BLIS library specific debug helpes. | ||
* | ||
* Copyright (C) 2020, Advanced Micro Devices, Inc | ||
* | ||
*==================================================================*/ | ||
|
||
|
||
#ifndef __AOCLDTL_BLIS_H | ||
#define __AOCLDTL_BLIS_H | ||
|
||
#include "blis.h" | ||
|
||
#if AOCL_DTL_LOG_ENABLE | ||
void AOCL_DTL_log_gemm_sizes(int8 loglevel, | ||
obj_t* alpha, | ||
obj_t* a, | ||
obj_t* b, | ||
obj_t* beta, | ||
obj_t* c, | ||
const char* filename, | ||
const char* functionn_name, | ||
int line); | ||
|
||
#define AOCL_DTL_LOG_GEMM_INPUTS(loglevel, alpha, a, b, beta, c) \ | ||
AOCL_DTL_log_gemm_sizes(loglevel, alpha, a, b, beta, c, __FILE__, __FUNCTION__, __LINE__); | ||
#else | ||
#define AOCL_DTL_LOG_GEMM_INPUTS(loglevel, alpha, a, b, beta, c) | ||
#endif | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.