[4/n] Log allocation placement.

Change-Id: I300be5f09b6ee77aa89584a6bddf4c7e57aa54f1
This commit is contained in:
Zdunowski, Piotr
2019-02-14 11:38:04 +01:00
committed by sys_ocldev
parent 378bd28bab
commit 842fb5dadc
8 changed files with 110 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2018 Intel Corporation
# Copyright (C) 2018-2019 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -14,6 +14,7 @@ set(RUNTIME_SRCS_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/device_factory_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/driver_info.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_32bit_memory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_allocation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_allocation.h
${CMAKE_CURRENT_SOURCE_DIR}/drm_buffer_object.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_buffer_object.h

View File

@@ -0,0 +1,21 @@
/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/os_interface/linux/drm_allocation.h"
#include "runtime/os_interface/linux/drm_buffer_object.h"
#include <sstream>
namespace OCLRT {
std::string DrmAllocation::getAllocationInfoString() const {
std::stringstream ss;
if (bo != nullptr) {
ss << " Handle: " << bo->peekHandle();
}
return ss.str();
}
} // namespace OCLRT

View File

@@ -24,6 +24,8 @@ class DrmAllocation : public GraphicsAllocation {
this->memoryPool = pool;
}
std::string getAllocationInfoString() const override;
BufferObject *getBO() const {
if (fragmentsStorage.fragmentCount) {
return fragmentsStorage.fragmentStorageData[0].osHandleStorage->bo;

View File

@@ -83,10 +83,9 @@ class WddmAllocation : public GraphicsAllocation {
void setCpuAddress(void *cpuPtr) { this->cpuPtr = cpuPtr; }
bool needsMakeResidentBeforeLock = false;
std::string getAllocationInfoString() const {
std::string getAllocationInfoString() const override {
std::stringstream ss;
ss << " Handle: " << handle;
ss << std::endl;
return ss.str();
}