[GPU] Show freed constants' name on Verbose memory dump (#8354)

This commit is contained in:
Taylor Yeonbok Lee 2021-11-24 10:58:58 +09:00 committed by GitHub
parent e19a6dc57d
commit 32052a8f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -823,6 +823,10 @@ void network::transfer_memory_to_device(std::shared_ptr<primitive_inst> instance
// Allocate and transfer memory
auto device_mem = inst_mem.get_engine()->allocate_memory(inst_mem.get_layout(), allocation_type::usm_device, false);
device_mem->copy_from(get_stream(), inst_mem);
GPU_DEBUG_GET_INSTANCE(debug_config);
GPU_DEBUG_IF(debug_config->verbose >= 2) {
GPU_DEBUG_COUT << "[" << node.id() << ": constant]" << std::endl;
}
_memory_pool->release_memory(&inst_mem, node.id(), get_id());
instance->set_output_memory(device_mem);
}

View File

@ -623,6 +623,9 @@ void program::transfer_memory_to_device() {
auto device_mem = mem.get_engine()->allocate_memory(data_node_layout, allocation_type::usm_device, false);
device_mem->copy_from(get_stream(), mem);
data_node.attach_memory(device_mem);
GPU_DEBUG_IF(debug_config->verbose >= 2) {
GPU_DEBUG_COUT << "[" << data_node.id() << ": constant]" << std::endl;
}
const_cast<memory::ptr&>(data_node.get_primitive()->mem).reset();
// TODO: Do we need finish call here? Maybe call it in network::execute() ?
get_stream().finish();