rpl_run w/o input file; queue create callback; test for n gpus and n threads

Change-Id: I37157c49cf6454de591cae97b5cc43287ea95956
This commit is contained in:
Evgeny committed 2018-10-30 14:19:45 -05:00
1 parent c05bded17c
commit f977ac2fbf
12 files changed
+137 -73

No files matched your search

+2 -1
View File
@@ -30,13 +30,14 @@ void InterceptQueue::HsaIntercept(HsaApiTable* table) {
InterceptQueue::mutex_t InterceptQueue::mutex_;
rocprofiler_callback_t InterceptQueue::dispatch_callback_ = NULL;
InterceptQueue::queue_callback_t InterceptQueue::create_callback_ = NULL;
InterceptQueue::queue_callback_t InterceptQueue::destroy_callback_ = NULL;
void* InterceptQueue::callback_data_ = NULL;
InterceptQueue::obj_map_t* InterceptQueue::obj_map_ = NULL;
const char* InterceptQueue::kernel_none_ = "";
Tracker* InterceptQueue::tracker_ = NULL;
bool InterceptQueue::tracker_on_ = false;
bool InterceptQueue::in_constr_call_ = false;
bool InterceptQueue::in_create_call_ = false;
InterceptQueue::queue_id_t InterceptQueue::current_queue_id = 0;
} // namespace rocprofiler
+15 -5
View File
@@ -63,8 +63,8 @@ class InterceptQueue {
std::lock_guard<mutex_t> lck(mutex_);
hsa_status_t status = HSA_STATUS_ERROR;
if (in_constr_call_) EXC_ABORT(status, "recursive InterceptQueueCreate()");
in_constr_call_ = true;
if (in_create_call_) EXC_ABORT(status, "recursive InterceptQueueCreate()");
in_create_call_ = true;
ProxyQueue* proxy = ProxyQueue::Create(agent, size, type, queue_event_callback, data, private_segment_size,
group_segment_size, queue, &status);
@@ -84,7 +84,11 @@ class InterceptQueue {
obj->queue_id = current_queue_id;
++current_queue_id;
in_constr_call_ = false;
if (create_callback_ != NULL) {
status = create_callback_(*queue, callback_data_);
}
in_create_call_ = false;
return status;
}
@@ -208,10 +212,15 @@ class InterceptQueue {
}
}
static void SetCallbacks(rocprofiler_callback_t dispatch_callback, queue_callback_t destroy_callback, void* data) {
static void SetCallbacks(rocprofiler_callback_t dispatch_callback,
queue_callback_t create_callback,
queue_callback_t destroy_callback,
void* data)
{
std::lock_guard<mutex_t> lck(mutex_);
callback_data_ = data;
dispatch_callback_ = dispatch_callback;
create_callback_ = create_callback;
destroy_callback_ = destroy_callback;
}
@@ -303,13 +312,14 @@ class InterceptQueue {
static mutex_t mutex_;
static const packet_word_t header_type_mask = (1ul << HSA_PACKET_HEADER_WIDTH_TYPE) - 1;
static rocprofiler_callback_t dispatch_callback_;
static queue_callback_t create_callback_;
static queue_callback_t destroy_callback_;
static void* callback_data_;
static obj_map_t* obj_map_;
static const char* kernel_none_;
static Tracker* tracker_;
static bool tracker_on_;
static bool in_constr_call_;
static bool in_create_call_;
static queue_id_t current_queue_id;
hsa_queue_t* const queue_;
+2 -2
View File
@@ -523,14 +523,14 @@ PUBLIC_API hsa_status_t rocprofiler_get_metrics(const rocprofiler_t* handle) {
// Set/remove queue callbacks
PUBLIC_API hsa_status_t rocprofiler_set_queue_callbacks(rocprofiler_queue_callbacks_t callbacks, void* data) {
API_METHOD_PREFIX
rocprofiler::InterceptQueue::SetCallbacks(callbacks.dispatch, callbacks.destroy, data);
rocprofiler::InterceptQueue::SetCallbacks(callbacks.dispatch, callbacks.create, callbacks.destroy, data);
API_METHOD_SUFFIX
}
// Remove queue callbacks
PUBLIC_API hsa_status_t rocprofiler_remove_queue_callbacks() {
API_METHOD_PREFIX
rocprofiler::InterceptQueue::SetCallbacks(NULL, NULL, NULL);
rocprofiler::InterceptQueue::SetCallbacks(NULL, NULL, NULL, NULL);
API_METHOD_SUFFIX
}