SWDEV-470698 - fix formatting, add format check workflow (#657)
This commit is contained in:
committed by
GitHub
szülő
5840940caa
commit
f7338717ae
@@ -161,10 +161,9 @@ bool Event::setStatus(int32_t status, uint64_t timeStamp) {
|
||||
|
||||
if (profilingInfo().enabled_) {
|
||||
ClPrint(LOG_DEBUG, LOG_CMD, "Command %p complete (Wall: %ld, CPU: %ld, GPU: %ld us)",
|
||||
&command(),
|
||||
((profilingInfo().end_ - epoch) / 1000),
|
||||
((profilingInfo().submitted_ - profilingInfo().queued_) / 1000),
|
||||
((profilingInfo().end_ - profilingInfo().start_) / 1000));
|
||||
&command(), ((profilingInfo().end_ - epoch) / 1000),
|
||||
((profilingInfo().submitted_ - profilingInfo().queued_) / 1000),
|
||||
((profilingInfo().end_ - profilingInfo().start_) / 1000));
|
||||
} else {
|
||||
ClPrint(LOG_DEBUG, LOG_CMD, "Command %p complete", &command());
|
||||
}
|
||||
@@ -200,8 +199,8 @@ bool Event::setCallback(int32_t status, Event::CallBackFunction callback, void*
|
||||
}
|
||||
|
||||
entry->next_ = callbacks_;
|
||||
while (!callbacks_.compare_exchange_weak(entry->next_, entry))
|
||||
; // Someone else is also updating the head of the linked list! reload.
|
||||
while (!callbacks_.compare_exchange_weak(
|
||||
entry->next_, entry)); // Someone else is also updating the head of the linked list! reload.
|
||||
|
||||
// Check if the event has already reached 'status'
|
||||
if (this->status() <= status && entry->callback_ != CallBackFunction(0)) {
|
||||
@@ -241,8 +240,8 @@ bool Event::awaitCompletion() {
|
||||
return false;
|
||||
}
|
||||
|
||||
ClPrint(LOG_DEBUG, LOG_WAIT, "Waiting for event %p to complete, current status %d",
|
||||
this, status());
|
||||
ClPrint(LOG_DEBUG, LOG_WAIT, "Waiting for event %p to complete, current status %d", this,
|
||||
status());
|
||||
auto* queue = command().queue();
|
||||
if ((queue != nullptr) && queue->vdev()->ActiveWait()) {
|
||||
while (status() > CL_COMPLETE) {
|
||||
@@ -271,8 +270,7 @@ bool Event::notifyCmdQueue(bool cpu_wait) {
|
||||
// If HW event was assigned, then notification can be ignored, since a barrier was issued
|
||||
// @note: Force the marker always in OCL for now, since OCL events require precise
|
||||
// sequence of the status update
|
||||
((HwEvent() == nullptr) || !amd::IS_HIP) &&
|
||||
!notified_.test_and_set()) {
|
||||
((HwEvent() == nullptr) || !amd::IS_HIP) && !notified_.test_and_set()) {
|
||||
// Make sure the queue is draining the enqueued commands.
|
||||
amd::Command* command = new amd::Marker(*queue, false, nullWaitList, this, cpu_wait);
|
||||
if (command == NULL) {
|
||||
@@ -314,7 +312,7 @@ Command::Command(HostQueue& queue, cl_command_type type, const EventWaitList& ev
|
||||
eventWaitList_(eventWaitList),
|
||||
commandWaitBits_(commandWaitBits) {
|
||||
// Retain the commands from the event wait list.
|
||||
for (const auto &event: eventWaitList) {
|
||||
for (const auto& event : eventWaitList) {
|
||||
event->retain();
|
||||
}
|
||||
}
|
||||
@@ -325,7 +323,7 @@ void Command::operator delete(void* ptr) {
|
||||
if (DEBUG_CLR_SYSMEM_POOL) {
|
||||
command_pool_->Free(ptr);
|
||||
} else {
|
||||
::operator delete (ptr);
|
||||
::operator delete(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +332,7 @@ void* Command::operator new(size_t size) {
|
||||
if (DEBUG_CLR_SYSMEM_POOL) {
|
||||
return command_pool_->Alloc(size);
|
||||
} else {
|
||||
return ::operator new (size);
|
||||
return ::operator new(size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +341,7 @@ void Command::releaseResources() {
|
||||
const Command::EventWaitList& events = eventWaitList();
|
||||
|
||||
// Release the commands from the event wait list.
|
||||
for (const auto &event: events) {
|
||||
for (const auto& event : events) {
|
||||
event->release();
|
||||
}
|
||||
}
|
||||
@@ -366,7 +364,7 @@ void Command::enqueue() {
|
||||
|
||||
// Notify all commands about the waiter. Barrier will be sent in order to obtain
|
||||
// HSA signal for a wait on the current queue
|
||||
for (const auto &event: eventWaitList()) {
|
||||
for (const auto& event : eventWaitList()) {
|
||||
if (!amd::IS_HIP && event->command().type() == CL_COMMAND_USER) {
|
||||
if (event->status() >= CL_COMPLETE) {
|
||||
reinterpret_cast<amd::UserEvent*>(event)->AddDependent(this);
|
||||
@@ -385,8 +383,8 @@ void Command::enqueue() {
|
||||
queue_->FormSubmissionBatch(this);
|
||||
|
||||
// Enqueue flushes, except profiling markers to avoid frequent expensive callbacks
|
||||
if (((type() == 0) && profilingInfo().batch_flush_) ||
|
||||
(type() == CL_COMMAND_MARKER) || (type() == CL_COMMAND_TASK)) {
|
||||
if (((type() == 0) && profilingInfo().batch_flush_) || (type() == CL_COMMAND_MARKER) ||
|
||||
(type() == CL_COMMAND_TASK)) {
|
||||
// The current HSA signal tracking logic requires profiling enabled for the markers
|
||||
EnableProfiling();
|
||||
// Update batch head for the current marker. Hence the status of all commands can be
|
||||
@@ -502,8 +500,7 @@ bool OneMemoryArgCommand::validatePeerMemory() {
|
||||
// extra memory objects.
|
||||
if (queue_device->settings().rocr_backend_) {
|
||||
const std::vector<Device*>& srcDevices = memory_->getContext().devices();
|
||||
if (!memory_->isArena() &&
|
||||
srcDevices.size() == 1 && queue_device != srcDevices[0]) {
|
||||
if (!memory_->isArena() && srcDevices.size() == 1 && queue_device != srcDevices[0]) {
|
||||
// current device and source device are not same hence
|
||||
// explicit allow access is needed for P2P access
|
||||
device::Memory* mem = memory_->getDeviceMemory(*srcDevices[0]);
|
||||
@@ -532,7 +529,7 @@ bool OneMemoryArgCommand::validateMemory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TwoMemoryArgsCommand::validatePeerMemory(){
|
||||
bool TwoMemoryArgsCommand::validatePeerMemory() {
|
||||
bool accessAllowed = true;
|
||||
amd::Device* queue_device = &queue()->device();
|
||||
// Explicite Allow access is needed when first time memory is accessed from other device.
|
||||
@@ -549,16 +546,14 @@ bool TwoMemoryArgsCommand::validatePeerMemory(){
|
||||
const std::vector<Device*>& dstDevices = memory2_->getContext().devices();
|
||||
// explicit allow access is needed for P2P access
|
||||
device::Memory* mem1 = memory1_->getDeviceMemory(*srcDevices[0]);
|
||||
if (!memory1_->isArena() &&
|
||||
!mem1->getAllowedPeerAccess() && srcDevices.size() == 1) {
|
||||
if (!memory1_->isArena() && !mem1->getAllowedPeerAccess() && srcDevices.size() == 1) {
|
||||
void* src = reinterpret_cast<void*>(mem1->originalDeviceAddress());
|
||||
accessAllowed = srcDevices[0]->deviceAllowAccess(src);
|
||||
mem1->setAllowedPeerAccess(true);
|
||||
}
|
||||
|
||||
device::Memory* mem2 = memory2_->getDeviceMemory(*dstDevices[0]);
|
||||
if (!memory2_->isArena() &&
|
||||
!mem2->getAllowedPeerAccess() && dstDevices.size() == 1) {
|
||||
if (!memory2_->isArena() && !mem2->getAllowedPeerAccess() && dstDevices.size() == 1) {
|
||||
void* dst = reinterpret_cast<void*>(mem2->originalDeviceAddress());
|
||||
accessAllowed &= dstDevices[0]->deviceAllowAccess(dst);
|
||||
mem2->setAllowedPeerAccess(true);
|
||||
@@ -695,8 +690,8 @@ int32_t NDRangeKernelCommand::captureAndValidate() {
|
||||
|
||||
int32_t error;
|
||||
uint64_t lclMemSize = kernel().getDeviceKernel(device)->workGroupInfo()->localMemSize_;
|
||||
parameters_ = kernel().parameters().capture(*queue()->vdev(),
|
||||
sharedMemBytes_ + lclMemSize, &error);
|
||||
parameters_ =
|
||||
kernel().parameters().capture(*queue()->vdev(), sharedMemBytes_ + lclMemSize, &error);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -799,7 +794,8 @@ bool CopyMemoryP2PCommand::validateMemory() {
|
||||
amd::ScopedLock lock(devices[0]->P2PStageOps());
|
||||
// Make sure runtime allocates memory on every device
|
||||
for (uint d = 0; d < devices[0]->GlbCtx().devices().size(); ++d) {
|
||||
device::Memory* mem = devices[0]->P2PStage()->getDeviceMemory(*devices[0]->GlbCtx().devices()[d]);
|
||||
device::Memory* mem =
|
||||
devices[0]->P2PStage()->getDeviceMemory(*devices[0]->GlbCtx().devices()[d]);
|
||||
if (nullptr == mem) {
|
||||
DevLogPrintfError("Cannot get P2P stage Device Memory for device: 0x%x \n",
|
||||
devices[0]->GlbCtx().devices()[d]);
|
||||
|
||||
Reference in New Issue
Block a user