Move m_Type to a local variable
BaseQueue class has a member function GetQueueType so m_Type is duplicated. m_Type is only used in one function. Move it to a local variable. Change-Id: Ice144cf723178dd628cb49261c23d10605f9ee7d Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
This commit is contained in:
gecommit door
Oak Zeng
bovenliggende
58b95e0a9d
commit
8d65e72045
@@ -28,8 +28,7 @@
|
||||
#include "hsakmt.h"
|
||||
|
||||
BaseQueue::BaseQueue()
|
||||
:m_Type(HSA_QUEUE_TYPE_SIZE),
|
||||
m_QueueBuf(NULL),
|
||||
:m_QueueBuf(NULL),
|
||||
m_SkipWaitConsumption(true) {
|
||||
}
|
||||
|
||||
@@ -39,6 +38,7 @@ BaseQueue::~BaseQueue(void) {
|
||||
|
||||
HSAKMT_STATUS BaseQueue::Create(unsigned int NodeId, unsigned int size, HSAuint64 *pointers) {
|
||||
HSAKMT_STATUS status;
|
||||
HSA_QUEUE_TYPE type = GetQueueType();
|
||||
|
||||
if (m_QueueBuf != NULL) {
|
||||
// Queue already exists, one queue per object
|
||||
@@ -47,16 +47,15 @@ HSAKMT_STATUS BaseQueue::Create(unsigned int NodeId, unsigned int size, HSAuint6
|
||||
|
||||
memset(&m_Resources, 0, sizeof(m_Resources));
|
||||
|
||||
m_Type = GetQueueType();
|
||||
m_QueueBuf = new HsaMemoryBuffer(size, NodeId, true/*zero*/, false/*local*/, true/*exec*/);
|
||||
|
||||
if (m_Type == HSA_QUEUE_COMPUTE_AQL) {
|
||||
if (type == HSA_QUEUE_COMPUTE_AQL) {
|
||||
m_Resources.Queue_read_ptr_aql = &pointers[0];
|
||||
m_Resources.Queue_write_ptr_aql = &pointers[1];
|
||||
}
|
||||
|
||||
status = hsaKmtCreateQueue(NodeId,
|
||||
m_Type,
|
||||
type,
|
||||
DEFAULT_QUEUE_PERCENTAGE,
|
||||
DEFAULT_PRIORITY,
|
||||
m_QueueBuf->As<unsigned int*>(),
|
||||
|
||||
Verwijs in nieuw issue
Block a user