From 2cdac5b7b67b6b949d0b8d0c605623cf2f9bafab Mon Sep 17 00:00:00 2001 From: Vincent Tang Date: Fri, 24 May 2024 20:02:46 +0000 Subject: [PATCH] #0: PLS SQUASH - final cleanup --- CMakeLists.txt | 3 --- ttnn/cpp/pybind11/decorators.hpp | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81b7d352761..7e5f2e8b967 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,6 @@ project(tt-metal include(${CMAKE_SOURCE_DIR}/cmake/macros.cmake) CHECK_COMPILERS() -include(${CMAKE_SOURCE_DIR}/cmake/macros.cmake) -CHECK_COMPILERS() - ############################################################################################################################ # Find all required libraries to build ############################################################################################################################ diff --git a/ttnn/cpp/pybind11/decorators.hpp b/ttnn/cpp/pybind11/decorators.hpp index 63c614b1a52..3841ae3569b 100644 --- a/ttnn/cpp/pybind11/decorators.hpp +++ b/ttnn/cpp/pybind11/decorators.hpp @@ -18,7 +18,7 @@ namespace ttnn { namespace decorators { template -constexpr auto resolve_call_method(Return (*execute)(Args...)) { +constexpr auto resolve_call_method(Return (*execute_on_worker_thread)(Args...)) { return [](const T& self, Args&&... args) { return self(std::forward(args)...); }; } @@ -41,17 +41,23 @@ template & overload) { std::apply( [&py_operation](auto... args) { - py_operation.def("__call__", resolve_call_method(&concrete_operation_t::execute), args...); + py_operation.def( + "__call__", + resolve_call_method(&concrete_operation_t::execute_on_worker_thread), + args...); }, overload.value); } -template +template < + typename registered_operation_t, + typename concrete_operation_t, + typename T, + typename function_t, + typename... py_args_t> void add_operator_call(T& py_operation, const pybind_overload_t& overload) { std::apply( - [&py_operation, &overload](auto... args) { - py_operation.def("__call__", overload.function, args...); - }, + [&py_operation, &overload](auto... args) { py_operation.def("__call__", overload.function, args...); }, overload.args.value); }