Этот коммит содержится в:
Evgeny
2018-12-20 20:21:37 -06:00
родитель 7bf1219daf
Коммит 9dd17cd351
8 изменённых файлов: 107 добавлений и 6383 удалений
+2 -3
Просмотреть файл
@@ -33,7 +33,7 @@ THE SOFTWARE.
#define DESTRUCTOR_API __attribute__((destructor))
typedef hsa_rt_utils::Timer::timestamp_t timestamp_t;
hsa_rt_utils::Timer timer;
hsa_rt_utils::Timer timer(NULL);
thread_local timestamp_t begin_timestamp = 0;
// HSA API callback function
@@ -46,12 +46,11 @@ void hsa_api_callback(
(void)arg;
const hsa_api_data_t* data = reinterpret_cast<const hsa_api_data_t*>(callback_data);
if (data->phase == ACTIVITY_API_PHASE_ENTER) {
begin_timestamp = timer.timestamp_fn_ns();
} else {
const timestamp_t end_timestamp = (cid == HSA_API_ID_hsa_shut_down) ? begin_timestamp : timer.timestamp_fn_ns();
// const timestamp_t duration_ns = end_timestamp - begin_timestamp;
// fprintf(stdout, "%s,%luns\n", roctracer_id_string(domain, cid, 0), duration_ns);
std::ostringstream os;
os << '(' << begin_timestamp << ":" << end_timestamp << ") " << hsa_api_data_pair_t(cid, *data);
fprintf(stdout, "%s\n", os.str().c_str());