From 892dd7f98eba69c82b642e85b165d1e0e9b88730 Mon Sep 17 00:00:00 2001 From: Yan Zaretskiy Date: Thu, 26 Sep 2024 00:48:29 +0000 Subject: [PATCH] #0: Remove unnecessary ProgramDeleter --- tt_metal/impl/device/device.cpp | 8 ++------ tt_metal/impl/device/device.hpp | 9 +-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/tt_metal/impl/device/device.cpp b/tt_metal/impl/device/device.cpp index a800ffe0213..29088091d19 100644 --- a/tt_metal/impl/device/device.cpp +++ b/tt_metal/impl/device/device.cpp @@ -27,10 +27,6 @@ namespace tt { namespace tt_metal { -void ::detail::ProgramDeleter::operator()(Program *p) { - delete p; -} - Device::Device( chip_id_t device_id, const uint8_t num_hw_cqs, size_t l1_small_size, size_t trace_region_size, const std::vector &l1_bank_remap, bool minimal, uint32_t worker_core) : id_(device_id), worker_thread_core(worker_core), work_executor(worker_core, device_id) { @@ -1455,8 +1451,8 @@ void Device::setup_tunnel_for_remote_devices() { void Device::compile_command_queue_programs() { ZoneScoped; - std::unique_ptr command_queue_program_ptr(new Program); - std::unique_ptr mmio_command_queue_program_ptr(new Program); + auto command_queue_program_ptr = std::make_unique(); + auto mmio_command_queue_program_ptr = std::make_unique(); std::string prefetch_kernel_path = "tt_metal/impl/dispatch/kernels/cq_prefetch.cpp"; std::string dispatch_kernel_path = "tt_metal/impl/dispatch/kernels/cq_dispatch.cpp"; diff --git a/tt_metal/impl/device/device.hpp b/tt_metal/impl/device/device.hpp index 88a0c04d779..b580b68dd93 100644 --- a/tt_metal/impl/device/device.hpp +++ b/tt_metal/impl/device/device.hpp @@ -34,13 +34,6 @@ class HWCommandQueue; class CommandQueue; namespace detail { -// TODO(agrebenisan): Need device to hold onto command queue programs, -// but the Program type is incomplete by this point. I can have -// a unique_ptr of incomplete type as long as I override the default -// delete function. -struct ProgramDeleter { - void operator()(Program* p); -}; class TraceDescriptor; @@ -296,7 +289,7 @@ class Device { std::unique_ptr sysmem_manager_; uint8_t num_hw_cqs_; - vector> command_queue_programs; + std::vector> command_queue_programs; bool using_fast_dispatch; program_cache::detail::ProgramCache program_cache;