Merge branch 'amd-master' into rkebichi-patch-kfd-1

This commit is contained in:
eshcherb
2019-11-11 19:05:50 -06:00
committed by GitHub
20 changed files with 1000 additions and 796 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ typedef enum {
ACTIVITY_DOMAIN_HSA_OPS = 1, // HSA async activity domain
ACTIVITY_DOMAIN_HCC_OPS = 2, // HCC async activity domain
ACTIVITY_DOMAIN_HIP_API = 3, // HIP API domain
ACTIVITY_DOMAIN_HIP_VDI = ACTIVITY_DOMAIN_HCC_OPS, // HIP VDI domain
ACTIVITY_DOMAIN_KFD_API = 4, // KFD API domain
ACTIVITY_DOMAIN_EXT_API = 5, // External ID domain
ACTIVITY_DOMAIN_ROCTX = 6, // ROCTX domain
@@ -83,7 +84,7 @@ struct activity_record_t {
};
// Activity sync calback type
typedef activity_record_t* (*activity_sync_callback_t)(uint32_t cid, activity_record_t* record, const void* data, void* arg);
typedef void* (*activity_sync_callback_t)(uint32_t cid, activity_record_t* record, const void* data, void* arg);
// Activity async calback type
typedef void (*activity_id_callback_t)(activity_correlation_id_t id);
typedef void (*activity_async_callback_t)(uint32_t op, void* record, void* arg);
+14 -2
View File
@@ -34,13 +34,25 @@ THE SOFTWARE.
#include "roctracer.h"
typedef void (*roctracer_start_cb_t)();
typedef void (*roctracer_stop_cb_t)();
typedef struct {
roctracer_start_cb_t start_cb;
roctracer_stop_cb_t stop_cb;
} roctracer_ext_properties_t;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
////////////////////////////////////////////////////////////////////////////////
// Mark API
void roctracer_mark(const char* str);
// Application annotatin API
// Tracing start API
void roctracer_start();
// Tracing stop API
void roctracer_stop();
////////////////////////////////////////////////////////////////////////////////
// External correlation id API
+15
View File
@@ -23,11 +23,26 @@ THE SOFTWARE.
#ifndef INC_ROCTRACER_HCC_H_
#define INC_ROCTRACER_HCC_H_
#if HIP_VDI
#define HIP_OP_ID_NUMBER 3
#define HIP_OP_ID_COPY 1
extern "C" {
typedef void (hipInitAsyncActivityCallback_t)(void* id_callback, void* op_callback, void* arg);
typedef bool (hipEnableAsyncActivityCallback_t)(unsigned op, bool enable);
typedef const char* (hipGetOpName_t)(unsigned op);
}
#else // !HIP_VDI
#if LOCAL_BUILD
#include <hc_prof_runtime.h>
#else
#include <hcc/hc_prof_runtime.h>
#endif
#define HIP_OP_ID_NUMBER hc::HSA_OP_ID_NUMBER
#define HIP_OP_ID_COPY hc::HSA_OP_ID_COPY
typedef decltype(Kalmar::CLAMP::InitActivityCallback) hipInitAsyncActivityCallback_t;
typedef decltype(Kalmar::CLAMP::EnableActivityCallback) hipEnableAsyncActivityCallback_t;
typedef decltype(Kalmar::CLAMP::GetCmdName) hipGetOpName_t;
#endif // !HIP_VDI
#include "roctracer.h"
+8
View File
@@ -77,6 +77,14 @@ bool RegisterApiCallback(uint32_t op, void* callback, void* arg);
// Remove ROCTX callback for given opertaion id
bool RemoveApiCallback(uint32_t op);
// Iterate range stack to support tracing start/stop
typedef struct {
const char* message;
uint32_t tid;
} roctx_range_data_t;
typedef void (*roctx_range_iterate_cb_t)(const roctx_range_data_t* data, void* arg);
void RangeStackIterate(roctx_range_iterate_cb_t callback, void* arg);
#ifdef __cplusplus
} // extern "C" block
#endif // __cplusplus