2024-04-11 13:29:28 +08:00
|
|
|
/*********************************************************************************************
|
|
|
|
|
Description: data for profiling
|
|
|
|
|
Copyright : All right reserved by NCIC.ICT
|
|
|
|
|
|
|
|
|
|
Author : Zhang Zhonghai
|
|
|
|
|
Date : 2024/04/08
|
|
|
|
|
***********************************************************************************************/
|
|
|
|
|
#ifndef __PROFILING_H
|
|
|
|
|
#define __PROFILING_H
|
|
|
|
|
#include <stdio.h>
|
2025-09-18 15:09:48 +08:00
|
|
|
#include <time.h>
|
2024-04-11 13:29:28 +08:00
|
|
|
|
|
|
|
|
#define TIME_DIVIDE_BY (CLOCKS_PER_SEC * 1.0)
|
|
|
|
|
|
|
|
|
|
#define LIM_TYPE 128
|
|
|
|
|
extern uint64_t gprof[LIM_TYPE];
|
|
|
|
|
extern uint64_t gdata[LIM_TYPE];
|
|
|
|
|
extern FILE *ins_f_arr[LIM_TYPE],
|
|
|
|
|
*del_f_arr[LIM_TYPE],
|
|
|
|
|
*score_f_arr[LIM_TYPE],
|
|
|
|
|
*retval_f_arr[LIM_TYPE];
|
|
|
|
|
|
2025-09-18 15:09:48 +08:00
|
|
|
// GLOBAL performance info
|
2024-04-11 13:29:28 +08:00
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
G_ALL = 0,
|
|
|
|
|
G_EXT_SCALAR,
|
|
|
|
|
G_EXT_AVX2_I16,
|
|
|
|
|
G_EXT_AVX2_U8,
|
|
|
|
|
G_EXT_AVX2_I16_SP,
|
2025-09-18 15:09:48 +08:00
|
|
|
G_ALN_I16,
|
|
|
|
|
G_ALN_U8,
|
|
|
|
|
G_ALN_AVX2_I16,
|
|
|
|
|
G_ALN_AVX2_U8
|
2024-04-11 13:29:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#ifdef SHOW_PERF
|
|
|
|
|
#define PROF_START(tmp_time) uint64_t prof_tmp_##tmp_time = get_msec()
|
|
|
|
|
#define PROF_END(result, tmp_time) result += get_msec() - prof_tmp_##tmp_time
|
|
|
|
|
#else
|
|
|
|
|
#define PROF_START(tmp_time)
|
|
|
|
|
#define PROF_END(result, tmp_time)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// get current milli seconds
|
|
|
|
|
uint64_t get_msec();
|
|
|
|
|
#endif
|