Skip to content

Commit

Permalink
Fix double move in launch op
Browse files Browse the repository at this point in the history
  • Loading branch information
sminakov-tt committed Jan 9, 2025
1 parent 76b29a0 commit cd8d4d6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ttnn/cpp/ttnn/decorators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ auto map_launch_op_args_to_execute_on_worker_thread_args(
const Tensors& input_tensors,
const OptionalConstTensors& optional_input_tensors,
const OptionalTensors& optional_output_tensors,
args_t&&... args) {
const args_t&... args) {
auto input_tensor_index = 0;
auto optional_input_tensor_index = 0;
auto optional_output_tensor_index = 0;
Expand All @@ -117,7 +117,7 @@ auto map_launch_op_args_to_execute_on_worker_thread_args(
} else {
return arg;
}
}(std::forward<args_t>(args))...};
}(args)...};
}

template <typename operation_t, typename T>
Expand Down Expand Up @@ -252,26 +252,26 @@ struct registered_operation_t {
// #8479: Fix and re-enable logging in cpp operation decorator
// detail::log("Arguments: ", std::forward<args_t>(args)...);

using execute_on_worker_thread_return_t = decltype(operation_t::invoke(std::forward<decltype(args)>(args)...));
using execute_on_worker_thread_return_t = decltype(operation_t::invoke(args...));

const Tensors input_tensors = detail::extract_args_to_vector<ttnn::Tensor>(std::forward<args_t>(args)...);
const Tensors input_tensors = detail::extract_args_to_vector<ttnn::Tensor>(args...);
const OptionalConstTensors optional_input_tensors =
detail::extract_args_to_vector<std::optional<const ttnn::Tensor>>(std::forward<args_t>(args)...);
detail::extract_args_to_vector<std::optional<const ttnn::Tensor>>(args...);

auto output_tensors = detail::create_async_output_tensors<operation_t, execute_on_worker_thread_return_t>(
input_tensors, optional_input_tensors, std::forward<decltype(args)>(args)...);
input_tensors, optional_input_tensors, args...);

const OptionalTensors optional_output_tensors =
detail::extract_args_to_vector<std::optional<ttnn::Tensor>>(std::forward<args_t>(args)...);
detail::extract_args_to_vector<std::optional<ttnn::Tensor>>(args...);

bool enable_autoformat = false;
tt::tt_metal::operation::launch_op(
[args...](
const Tensors& input_tensors,
const OptionalConstTensors& optional_input_tensors,
const OptionalTensors& optional_output_tensors) mutable {
const OptionalTensors& optional_output_tensors) {
auto execute_on_worker_thread_args = detail::map_launch_op_args_to_execute_on_worker_thread_args(
input_tensors, optional_input_tensors, optional_output_tensors, std::forward<args_t>(args)...);
input_tensors, optional_input_tensors, optional_output_tensors, args...);
return std::apply(
[](auto&&... args) {
return detail::map_execute_on_worker_thread_return_to_launch_op_return<operation_t>(
Expand Down

0 comments on commit cd8d4d6

Please sign in to comment.