Fix bad casts in tools.

Also virtualize queue profiling enable.

Change-Id: I761b41269be3df7eb64a5914ee9951ed6b51bb04


[ROCm/ROCR-Runtime commit: 6455a69b03]
This commit is contained in:
Sean Keely
2017-11-04 04:09:20 -05:00
parent 0fcdd63d88
commit 76c28f38c4
5 changed files with 9 additions and 4 deletions
@@ -297,7 +297,7 @@ class GpuAgent : public GpuAgentInt {
return regions_;
}
// @brief OVerride from core::Agent.
// @brief Override from core::Agent.
const core::Isa* isa() const override { return isa_; }
// @brief Override from amd::GpuAgentInt.
@@ -116,6 +116,7 @@ class QueueWrapper : public Queue {
void ExecutePM4(uint32_t* cmd_data, size_t cmd_size_b) override {
wrapped->ExecutePM4(cmd_data, cmd_size_b);
}
void SetProfiling(bool enabled) override { wrapped->SetProfiling(enabled); }
protected:
void do_set_public_handle(hsa_queue_t* handle) {
@@ -294,6 +294,11 @@ class Queue : public Checked<0xFA3906A679F9DB49>, private LocalQueue {
// @brief Submits a block of PM4 and waits until it has been executed.
virtual void ExecutePM4(uint32_t* cmd_data, size_t cmd_size_b) = 0;
virtual void SetProfiling(bool enabled) {
AMD_HSA_BITS_SET(amd_queue_.queue_properties, AMD_QUEUE_PROPERTIES_ENABLE_PROFILING,
(enabled != 0));
}
/// @ brief Reports async queue errors to stderr if no other error handler was registered.
static void DefaultErrorHandler(hsa_status_t status, hsa_queue_t* source, void* data);
@@ -266,11 +266,9 @@ hsa_status_t hsa_amd_profiling_set_profiler_enabled(hsa_queue_t* queue, int enab
IS_OPEN();
core::Queue* cmd_queue = core::Queue::Convert(queue);
IS_VALID(cmd_queue);
AMD_HSA_BITS_SET(cmd_queue->amd_queue_.queue_properties,
AMD_QUEUE_PROPERTIES_ENABLE_PROFILING, (enable != 0));
cmd_queue->SetProfiling(enable);
return HSA_STATUS_SUCCESS;
CATCH;
@@ -235,6 +235,7 @@ void InterceptQueue::StoreRelaxed(hsa_signal_value_t value) {
next_packet_ = i;
Cursor.queue = nullptr;
atomic::Store(&amd_queue_.read_dispatch_id, next_packet_, std::memory_order_release);
}
} // namespace core