adding context pool

Change-Id: Id8c6ee43ac6c86480848a5d3e759c42730cf388a


[ROCm/rocprofiler commit: 632309a626]
This commit is contained in:
Evgeny
2019-03-03 01:04:00 -06:00
parent 8feba010df
commit 878e8e20b1
7 changed files with 514 additions and 50 deletions
+44
View File
@@ -383,6 +383,50 @@ hsa_status_t rocprofiler_queue_create_profiled(
void* data, uint32_t private_segment_size, uint32_t group_segment_size,
hsa_queue_t** queue);
////////////////////////////////////////////////////////////////////////////////
// Profiling pool
//
// Support for profiling contexts pool
// Profiling pool
typedef void rocprofiler_pool_t;
// Profiling pool entry
typedef struct {
rocprofiler_t* context; // context object
void* payload; // payload data object
} rocprofiler_pool_entry_t;
// Profiling handler, calling on profiling completion
typedef bool (*rocprofiler_pool_handler_t)(const rocprofiler_pool_entry_t* entry, void* arg);
// Profiling preperties
typedef struct {
uint32_t num_entries; // pool size entries
uint32_t payload_bytes; // payload size bytes
rocprofiler_pool_handler_t handler; // handler on context completion
void* handler_arg; // the handler arg
} rocprofiler_pool_properties_t;
// Open profiling pool
hsa_status_t rocprofiler_pool_open(hsa_agent_t agent, // GPU handle
rocprofiler_feature_t* features, // [in] profiling features array
uint32_t feature_count, // profiling info count
rocprofiler_pool_t** pool, // [out] context object
uint32_t mode, // profiling mode mask
rocprofiler_pool_properties_t*); // pool properties
// Close profiling pool
hsa_status_t rocprofiler_pool_close(rocprofiler_pool_t* pool); // profiling pool handle
// Fetch profiling pool entry
hsa_status_t rocprofiler_pool_fetch(rocprofiler_pool_t* pool, // profiling pool handle
rocprofiler_pool_entry_t* entry); // [out] empty profling pool entry
// Flush profiling pool
hsa_status_t rocprofiler_pool_flush(rocprofiler_pool_t* pool); // profiling pool handle
////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
} // extern "C" block
#endif // __cplusplus