removing _ANY ops

Esse commit está contido em:
Evgeny committed 2019-01-11 22:15:35 -06:00
1 pai a0169f594c
commit 0cde85dbb7
7 files changed
+232 -110

No files matched your search

+25 -6
Ver Arquivo
@@ -28,6 +28,7 @@ THE SOFTWARE.
#include <cstdint>
#include <cstddef>
#include <iostream>
#include <mutex>
#define HSART_CALL(call) \
do { \
@@ -80,12 +81,9 @@ class Timer {
return timestamp_to_ns(timestamp);
}
Timer() {
init(hsa_system_get_info);
}
Timer(hsa_system_get_info_fn_t f) {
init(f);
Timer(hsa_system_get_info_fn_t f = NULL) {
if (f != NULL) init(f);
else init(hsa_system_get_info);
}
private:
@@ -95,6 +93,27 @@ class Timer {
freq_t timestamp_rate_;
};
class TimerFactory {
public:
typedef std::mutex mutex_t;
static Timer* Create(Timer::hsa_system_get_info_fn_t f = NULL) {
if (instance_ == NULL) {
std::lock_guard<mutex_t> lck(mutex_);
if (instance_ == NULL) instance_ = new Timer(f);
}
return instance_;
}
static Timer& Instance() {
return *instance_;
}
private:
static Timer* instance_;
static mutex_t mutex_;
};
} // namespace hsa_rt_utils
#endif // INC_ROCTRACER_HSA_RT_UTILS_HPP_
+5 -8
Ver Arquivo
@@ -23,15 +23,12 @@ THE SOFTWARE.
#ifndef INC_EXT_PROF_PROTOCOL_H_
#define INC_EXT_PROF_PROTOCOL_H_
#define HCC_ENABLED 1
// Traced API domains
typedef enum {
ACTIVITY_DOMAIN_ANY = 0, // Any domain
ACTIVITY_DOMAIN_HSA_API = 1, // HSA domain
ACTIVITY_DOMAIN_HCC_OPS = 2, // HCC domain
ACTIVITY_DOMAIN_HIP_API = 3, // HIP domain
ACTIVITY_DOMAIN_NUMBER = 4
ACTIVITY_DOMAIN_HSA_API = 0, // HSA domain
ACTIVITY_DOMAIN_HCC_OPS = 1, // HCC domain
ACTIVITY_DOMAIN_HIP_API = 2, // HIP domain
ACTIVITY_DOMAIN_NUMBER = 3
} activity_domain_t;
// API calback type
@@ -53,7 +50,7 @@ typedef uint64_t activity_correlation_id_t;
struct activity_record_t {
uint32_t domain; // activity domain id
activity_kind_t kind; // activity kind
activity_op_t activity_id; // activity op
activity_op_t op; // activity op
activity_correlation_id_t correlation_id; // activity ID
uint64_t begin_ns; // host begin timestamp
uint64_t end_ns; // host end timestamp