fix: Replace printf with current logging practice

* add missing stdout flush

Signed-off-by: Kozlowski, Marek <marek.kozlowski@intel.com>
This commit is contained in:
Kozlowski, Marek
2024-07-15 13:36:19 +00:00
committed by Compute-Runtime-Automation
parent 9a6403f3bc
commit bd8fc07bb7
2 changed files with 4 additions and 10 deletions

View File

@@ -88,9 +88,7 @@ inline void PageFaultManager::migrateStorageToGpuDomain(void *ptr, PageFaultData
end = std::chrono::steady_clock::now();
long long elapsedTime = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count();
if (debugManager.flags.PrintUmdSharedMigration.get()) {
printf("UMD transferred shared allocation 0x%llx (%zu B) from CPU to GPU (%f us)\n", reinterpret_cast<unsigned long long int>(ptr), pageFaultData.size, elapsedTime / 1e3);
}
PRINT_DEBUG_STRING(debugManager.flags.PrintUmdSharedMigration.get(), stdout, "UMD transferred shared allocation 0x%llx (%zu B) from CPU to GPU (%f us)\n", reinterpret_cast<unsigned long long int>(ptr), pageFaultData.size, elapsedTime / 1e3);
this->protectCPUMemoryAccess(ptr, pageFaultData.size);
}
@@ -137,9 +135,7 @@ inline void PageFaultManager::migrateStorageToCpuDomain(void *ptr, PageFaultData
end = std::chrono::steady_clock::now();
long long elapsedTime = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count();
if (debugManager.flags.PrintUmdSharedMigration.get()) {
printf("UMD transferred shared allocation 0x%llx (%zu B) from GPU to CPU (%f us)\n", reinterpret_cast<unsigned long long int>(ptr), pageFaultData.size, elapsedTime / 1e3);
}
PRINT_DEBUG_STRING(debugManager.flags.PrintUmdSharedMigration.get(), stdout, "UMD transferred shared allocation 0x%llx (%zu B) from GPU to CPU (%f us)\n", reinterpret_cast<unsigned long long int>(ptr), pageFaultData.size, elapsedTime / 1e3);
pageFaultData.unifiedMemoryManager->nonGpuDomainAllocs.push_back(ptr);
}
pageFaultData.domain = AllocationDomain::cpu;