diff --git a/kernels/portable/cpu/op_bitwise_and.cpp b/kernels/portable/cpu/op_bitwise_and.cpp index 92ba2c024d6..f62d0b70dd4 100644 --- a/kernels/portable/cpu/op_bitwise_and.cpp +++ b/kernels/portable/cpu/op_bitwise_and.cpp @@ -6,68 +6,20 @@ * LICENSE file in the root directory of this source tree. */ -// patternlint-disable-next-line executorch-cpp-nostdinc -#include - #include -#include -#include -#include -#include namespace torch { namespace executor { namespace native { -using Tensor = exec_aten::Tensor; - Tensor& bitwise_and_Tensor_out( KernelRuntimeContext& ctx, const Tensor& a, const Tensor& b, Tensor& out) { - ET_KERNEL_CHECK( - ctx, - resize_to_broadcast_target_size(a, b, out) == Error::Ok, - InvalidArgument, - out); - - ET_KERNEL_CHECK( - ctx, tensors_have_same_dim_order(a, b, out), InvalidArgument, out); - - ScalarType a_type = a.scalar_type(); - ScalarType b_type = b.scalar_type(); - ScalarType common_type = promoteTypes(a_type, b_type); - ScalarType out_type = out.scalar_type(); - - ET_KERNEL_CHECK(ctx, canCast(common_type, out_type), InvalidArgument, out); - - ET_SWITCH_INT_TYPES_AND( - Bool, a_type, ctx, "bitwise_and.Tensor_out", CTYPE_A, [&]() { - ET_SWITCH_INT_TYPES_AND( - Bool, b_type, ctx, "bitwise_and.Tensor_out", CTYPE_B, [&]() { - using CTYPE_IN = typename torch::executor:: - promote_types::type; - ET_DCHECK(CppTypeToScalarType::value == common_type); - ET_SWITCH_REAL_TYPES_AND( - Bool, - out_type, - ctx, - "bitwise_and.Tensor_out", - CTYPE_OUT, - [&]() { - internal::BitwiseOpInner< - can_cast::value, - std::bit_and, - CTYPE_A, - CTYPE_B, - CTYPE_IN, - CTYPE_OUT>::run(a, b, out); - }); - }); - }); - - return out; + // @lint-ignore CLANGTIDY facebook-hte-CArray + static constexpr const char op_name[] = "bitwise_and.Tensor_out"; + return internal::bitwise_tensor_out(ctx, a, b, out); } Tensor& bitwise_and_Scalar_out( @@ -75,66 +27,9 @@ Tensor& bitwise_and_Scalar_out( const Tensor& a, const Scalar& b, Tensor& out) { - (void)ctx; - - // Resize for dynamic shape - ET_KERNEL_CHECK_MSG( - ctx, - resize_tensor(out, a.sizes()) == Error::Ok, - InvalidArgument, - out, - "Failed to resize output tensor."); - - ET_KERNEL_CHECK( - ctx, tensors_have_same_dim_order(a, out), InvalidArgument, out); - - ScalarType a_type = a.scalar_type(); - ScalarType b_type = utils::get_scalar_dtype(b); - ScalarType common_type = utils::promote_type_with_scalar(a_type, b); - ScalarType out_type = out.scalar_type(); - - ET_KERNEL_CHECK(ctx, canCast(common_type, out_type), InvalidArgument, out); - - ET_SWITCH_INT_TYPES_AND( - Bool, a_type, ctx, "bitwise_and.Scalar_out", CTYPE_A, [&]() { - ET_SWITCH_SCALAR_OBJ_INTB_TYPES( - b_type, ctx, "bitwise_and.Scalar_out", CTYPE_B, [&]() { - CTYPE_B val_b = 0; - utils::extract_scalar(b, &val_b); - ET_SWITCH_INT_TYPES_AND( - Bool, - common_type, - ctx, - "bitwise_and.Scalar_out", - CTYPE_IN, - [&]() { - ET_SWITCH_REAL_TYPES_AND( - Bool, - out_type, - ctx, - "bitwise_and.Scalar_out", - CTYPE_OUT, - [&]() { - apply_unary_map_fn( - [val_b](const CTYPE_A val_a) { - CTYPE_IN a_casted = - static_cast(val_a); - CTYPE_IN b_casted = - static_cast(val_b); - CTYPE_IN value = std::bit_and()( - a_casted, b_casted); - - return static_cast(value); - }, - a.const_data_ptr(), - out.mutable_data_ptr(), - out.numel()); - }); - }); - }); - }); - - return out; + // @lint-ignore CLANGTIDY facebook-hte-CArray + static constexpr const char op_name[] = "bitwise_and.Scalar_out"; + return internal::bitwise_scalar_out(ctx, a, b, out); } } // namespace native diff --git a/kernels/portable/cpu/op_bitwise_or.cpp b/kernels/portable/cpu/op_bitwise_or.cpp index 5fdd02f3aec..8028815fbf9 100644 --- a/kernels/portable/cpu/op_bitwise_or.cpp +++ b/kernels/portable/cpu/op_bitwise_or.cpp @@ -6,68 +6,20 @@ * LICENSE file in the root directory of this source tree. */ -// patternlint-disable-next-line executorch-cpp-nostdinc -#include - #include -#include -#include -#include -#include namespace torch { namespace executor { namespace native { -using Tensor = exec_aten::Tensor; - Tensor& bitwise_or_Tensor_out( KernelRuntimeContext& ctx, const Tensor& a, const Tensor& b, Tensor& out) { - ET_KERNEL_CHECK( - ctx, - resize_to_broadcast_target_size(a, b, out) == Error::Ok, - InvalidArgument, - out); - - ET_KERNEL_CHECK( - ctx, tensors_have_same_dim_order(a, b, out), InvalidArgument, out); - - ScalarType a_type = a.scalar_type(); - ScalarType b_type = b.scalar_type(); - ScalarType common_type = promoteTypes(a_type, b_type); - ScalarType out_type = out.scalar_type(); - - ET_KERNEL_CHECK(ctx, canCast(common_type, out_type), InvalidArgument, out); - - ET_SWITCH_INT_TYPES_AND( - Bool, a_type, ctx, "bitwise_or.Tensor_out", CTYPE_A, [&]() { - ET_SWITCH_INT_TYPES_AND( - Bool, b_type, ctx, "bitwise_or.Tensor_out", CTYPE_B, [&]() { - using CTYPE_IN = typename torch::executor:: - promote_types::type; - ET_DCHECK(CppTypeToScalarType::value == common_type); - ET_SWITCH_REAL_TYPES_AND( - Bool, - out_type, - ctx, - "bitwise_or.Tensor_out", - CTYPE_OUT, - [&]() { - internal::BitwiseOpInner< - can_cast::value, - std::bit_or, - CTYPE_A, - CTYPE_B, - CTYPE_IN, - CTYPE_OUT>::run(a, b, out); - }); - }); - }); - - return out; + // @lint-ignore CLANGTIDY facebook-hte-CArray + static constexpr const char op_name[] = "bitwise_or.Tensor_out"; + return internal::bitwise_tensor_out(ctx, a, b, out); } Tensor& bitwise_or_Scalar_out( @@ -75,66 +27,9 @@ Tensor& bitwise_or_Scalar_out( const Tensor& a, const Scalar& b, Tensor& out) { - (void)ctx; - - ET_KERNEL_CHECK( - ctx, tensors_have_same_dim_order(a, out), InvalidArgument, out); - - // Resize for dynamic shape - ET_KERNEL_CHECK_MSG( - ctx, - resize_tensor(out, a.sizes()) == Error::Ok, - InvalidArgument, - out, - "Failed to resize output tensor."); - - ScalarType a_type = a.scalar_type(); - ScalarType b_type = utils::get_scalar_dtype(b); - ScalarType common_type = utils::promote_type_with_scalar(a_type, b); - ScalarType out_type = out.scalar_type(); - - ET_KERNEL_CHECK(ctx, canCast(common_type, out_type), InvalidArgument, out); - - ET_SWITCH_INT_TYPES_AND( - Bool, a_type, ctx, "bitwise_or.Scalar_out", CTYPE_A, [&]() { - ET_SWITCH_SCALAR_OBJ_INTB_TYPES( - b_type, ctx, "bitwise_or.Scalar_out", CTYPE_B, [&]() { - CTYPE_B val_b = 0; - utils::extract_scalar(b, &val_b); - ET_SWITCH_INT_TYPES_AND( - Bool, - common_type, - ctx, - "bitwise_or.Scalar_out", - CTYPE_IN, - [&]() { - ET_SWITCH_REAL_TYPES_AND( - Bool, - out_type, - ctx, - "bitwise_or.Scalar_out", - CTYPE_OUT, - [&]() { - apply_unary_map_fn( - [val_b](const CTYPE_A val_a) { - CTYPE_IN a_casted = - static_cast(val_a); - CTYPE_IN b_casted = - static_cast(val_b); - CTYPE_IN value = - std::bit_or()(a_casted, b_casted); - - return static_cast(value); - }, - a.const_data_ptr(), - out.mutable_data_ptr(), - out.numel()); - }); - }); - }); - }); - - return out; + // @lint-ignore CLANGTIDY facebook-hte-CArray + static constexpr const char op_name[] = "bitwise_or.Scalar_out"; + return internal::bitwise_scalar_out(ctx, a, b, out); } } // namespace native diff --git a/kernels/portable/cpu/op_bitwise_xor.cpp b/kernels/portable/cpu/op_bitwise_xor.cpp index aed9429d6b2..85badf95789 100644 --- a/kernels/portable/cpu/op_bitwise_xor.cpp +++ b/kernels/portable/cpu/op_bitwise_xor.cpp @@ -6,68 +6,20 @@ * LICENSE file in the root directory of this source tree. */ -// patternlint-disable-next-line executorch-cpp-nostdinc -#include - #include -#include -#include -#include -#include namespace torch { namespace executor { namespace native { -using Tensor = exec_aten::Tensor; - Tensor& bitwise_xor_Tensor_out( KernelRuntimeContext& ctx, const Tensor& a, const Tensor& b, Tensor& out) { - ET_KERNEL_CHECK( - ctx, - resize_to_broadcast_target_size(a, b, out) == Error::Ok, - InvalidArgument, - out); - - ET_KERNEL_CHECK( - ctx, tensors_have_same_dim_order(a, b, out), InvalidArgument, out); - - ScalarType a_type = a.scalar_type(); - ScalarType b_type = b.scalar_type(); - ScalarType common_type = promoteTypes(a_type, b_type); - ScalarType out_type = out.scalar_type(); - - ET_KERNEL_CHECK(ctx, canCast(common_type, out_type), InvalidArgument, out); - - ET_SWITCH_INT_TYPES_AND( - Bool, a_type, ctx, "bitwise_xor.Tensor_out", CTYPE_A, [&]() { - ET_SWITCH_INT_TYPES_AND( - Bool, b_type, ctx, "bitwise_xor.Tensor_out", CTYPE_B, [&]() { - using CTYPE_IN = typename torch::executor:: - promote_types::type; - ET_DCHECK(CppTypeToScalarType::value == common_type); - ET_SWITCH_REAL_TYPES_AND( - Bool, - out_type, - ctx, - "bitwise_xor.Tensor_out", - CTYPE_OUT, - [&]() { - internal::BitwiseOpInner< - can_cast::value, - std::bit_xor, - CTYPE_A, - CTYPE_B, - CTYPE_IN, - CTYPE_OUT>::run(a, b, out); - }); - }); - }); - - return out; + // @lint-ignore CLANGTIDY facebook-hte-CArray + static constexpr const char op_name[] = "bitwise_xor.Tensor_out"; + return internal::bitwise_tensor_out(ctx, a, b, out); } Tensor& bitwise_xor_Scalar_out( @@ -75,66 +27,9 @@ Tensor& bitwise_xor_Scalar_out( const Tensor& a, const Scalar& b, Tensor& out) { - (void)ctx; - - // Resize for dynamic shape - ET_KERNEL_CHECK_MSG( - ctx, - resize_tensor(out, a.sizes()) == Error::Ok, - InvalidArgument, - out, - "Failed to resize output tensor."); - - ET_KERNEL_CHECK( - ctx, tensors_have_same_dim_order(a, out), InvalidArgument, out); - - ScalarType a_type = a.scalar_type(); - ScalarType b_type = utils::get_scalar_dtype(b); - ScalarType common_type = utils::promote_type_with_scalar(a_type, b); - ScalarType out_type = out.scalar_type(); - - ET_KERNEL_CHECK(ctx, canCast(common_type, out_type), InvalidArgument, out); - - ET_SWITCH_INT_TYPES_AND( - Bool, a_type, ctx, "bitwise_xor.Scalar_out", CTYPE_A, [&]() { - ET_SWITCH_SCALAR_OBJ_INTB_TYPES( - b_type, ctx, "bitwise_xor.Scalar_out", CTYPE_B, [&]() { - CTYPE_B val_b = 0; - utils::extract_scalar(b, &val_b); - ET_SWITCH_INT_TYPES_AND( - Bool, - common_type, - ctx, - "bitwise_xor.Scalar_out", - CTYPE_IN, - [&]() { - ET_SWITCH_REAL_TYPES_AND( - Bool, - out_type, - ctx, - "bitwise_xor.Scalar_out", - CTYPE_OUT, - [&]() { - apply_unary_map_fn( - [val_b](const CTYPE_A val_a) { - CTYPE_IN a_casted = - static_cast(val_a); - CTYPE_IN b_casted = - static_cast(val_b); - CTYPE_IN value = std::bit_xor()( - a_casted, b_casted); - - return static_cast(value); - }, - a.const_data_ptr(), - out.mutable_data_ptr(), - out.numel()); - }); - }); - }); - }); - - return out; + // @lint-ignore CLANGTIDY facebook-hte-CArray + static constexpr const char op_name[] = "bitwise_xor.Scalar_out"; + return internal::bitwise_scalar_out(ctx, a, b, out); } } // namespace native diff --git a/kernels/portable/cpu/pattern/bitwise_op.h b/kernels/portable/cpu/pattern/bitwise_op.h index dda4fe5cd55..6e4c111b8f2 100644 --- a/kernels/portable/cpu/pattern/bitwise_op.h +++ b/kernels/portable/cpu/pattern/bitwise_op.h @@ -8,7 +8,8 @@ #pragma once -#include +#include +#include #include namespace torch { @@ -16,55 +17,124 @@ namespace executor { namespace native { namespace internal { -template < - bool can_cast, - template - class OpFunc, - typename CTYPE_A, - typename CTYPE_B, - typename CTYPE_IN, - typename CTYPE_OUT> -struct BitwiseOpInner; - -template < - template - class OpFunc, - typename CTYPE_A, - typename CTYPE_B, - typename CTYPE_IN, - typename CTYPE_OUT> -struct BitwiseOpInner { - static void run(const Tensor& a, const Tensor& b, Tensor& out) { - apply_binary_elementwise_fn( - // NOLINTNEXTLINE(facebook-hte-ConstantArgumentPassByValue) - [](const CTYPE_A val_a, const CTYPE_B val_b) { - CTYPE_IN a_casted = static_cast(val_a); - CTYPE_IN b_casted = static_cast(val_b); - CTYPE_IN value = OpFunc()(a_casted, b_casted); - - return static_cast(value); - }, - a, - b, - out); +#define DEFINE_BINARY_OPERATOR_TEMPLATE(name, op) \ + template \ + T name(const T val_a, const T val_b) { \ + return val_a op val_b; \ } -}; -struct ReportCanCastBug { - static void run(const Tensor&, const Tensor&, Tensor&) { - ET_DCHECK_MSG(false, "BUG: canCast should have been checked above"); +DEFINE_BINARY_OPERATOR_TEMPLATE(bitwise_and, &) +DEFINE_BINARY_OPERATOR_TEMPLATE(bitwise_or, |) +DEFINE_BINARY_OPERATOR_TEMPLATE(bitwise_xor, ^) + +template +using bitwise_fn = T (*)(const T, const T); + +template +constexpr bitwise_fn get_bitwise_fn() { + std::string_view op = op_name; + if (op == "bitwise_and.Tensor_out" || op == "bitwise_and.Scalar_out") { + return bitwise_and; + } + if (op == "bitwise_or.Tensor_out" || op == "bitwise_or.Scalar_out") { + return bitwise_or; + } + if (op == "bitwise_xor.Tensor_out" || op == "bitwise_xor.Scalar_out") { + return bitwise_xor; } + return nullptr; }; -template < - template - class OpFunc, - typename CTYPE_A, - typename CTYPE_B, - typename CTYPE_IN, - typename CTYPE_OUT> -struct BitwiseOpInner - : public ReportCanCastBug {}; +template +struct BitwiseFnForOp { + static constexpr auto value = get_bitwise_fn(); + static_assert(value != nullptr, "unknown op_name!"); +}; + +template +Tensor& bitwise_tensor_out( + RuntimeContext& ctx, + const Tensor& a, + const Tensor& b, + Tensor& out) { + // Common Dtype + ScalarType common_type = promoteTypes(a.scalar_type(), b.scalar_type()); + + // Check Common Dtype + ET_KERNEL_CHECK( + ctx, canCast(common_type, out.scalar_type()), InvalidArgument, out); + + // Check Dim Order + ET_KERNEL_CHECK( + ctx, tensors_have_same_dim_order(a, b, out), InvalidArgument, out); + + // Resize + ET_KERNEL_CHECK( + ctx, + resize_to_broadcast_target_size(a, b, out) == Error::Ok, + InvalidArgument, + out); + + // Compute Dtype + ScalarType compute_type = utils::get_compute_type(common_type); + + ET_SWITCH_INT_TYPES_AND( + Bool, compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() { + utils::apply_bitensor_elementwise_fn( + BitwiseFnForOp::value, + ctx, + a, + utils::SupportedTensorDtypes::INTB, + b, + utils::SupportedTensorDtypes::INTB, + out, + utils::SupportedTensorDtypes::REALHBBF16); + }); + + return out; +} + +template +Tensor& bitwise_scalar_out( + RuntimeContext& ctx, + const Tensor& a, + const Scalar& b, + Tensor& out) { + // Common Dtype + ScalarType common_type = utils::promote_type_with_scalar(a.scalar_type(), b); + + // Check Common Dtype + ET_KERNEL_CHECK( + ctx, canCast(common_type, out.scalar_type()), InvalidArgument, out); + + // Check Dim Order + ET_KERNEL_CHECK( + ctx, tensors_have_same_dim_order(a, out), InvalidArgument, out); + + // Resize + ET_KERNEL_CHECK( + ctx, resize_tensor(out, a.sizes()) == Error::Ok, InvalidArgument, out); + + // Compute Dtype + ScalarType compute_type = utils::get_compute_type(common_type); + + ET_SWITCH_INT_TYPES_AND( + Bool, compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() { + const CTYPE_COMPUTE val_b = utils::scalar_to(b); + utils::apply_unitensor_elementwise_fn( + [val_b](const CTYPE_COMPUTE val_a) { + return BitwiseFnForOp::value( + val_a, val_b); + }, + ctx, + a, + utils::SupportedTensorDtypes::INTB, + out, + utils::SupportedTensorDtypes::REALHBBF16); + }); + + return out; +} } // namespace internal } // namespace native diff --git a/kernels/portable/cpu/pattern/targets.bzl b/kernels/portable/cpu/pattern/targets.bzl index 81b4345c75e..4459930a347 100644 --- a/kernels/portable/cpu/pattern/targets.bzl +++ b/kernels/portable/cpu/pattern/targets.bzl @@ -25,9 +25,6 @@ def define_common_targets(): "bitwise_op.h", ], compiler_flags = [], - deps = [ - "//executorch/runtime/kernel:kernel_includes", - ], visibility = ["//executorch/kernels/portable/cpu/...", "//executorch/kernels/optimized/cpu/..."], ) diff --git a/kernels/portable/cpu/util/elementwise_util.cpp b/kernels/portable/cpu/util/elementwise_util.cpp index 2988c604e8c..ef94c599b70 100644 --- a/kernels/portable/cpu/util/elementwise_util.cpp +++ b/kernels/portable/cpu/util/elementwise_util.cpp @@ -25,6 +25,8 @@ bool check_tensor_dtype( return executorch::runtime::tensor_is_realhbf16_type(t); case SupportedTensorDtypes::FLOATHBF16: return executorch::runtime::tensor_is_floating_type(t); + case SupportedTensorDtypes::INTB: + return executorch::runtime::tensor_is_integral_type(t, true); case SupportedTensorDtypes::BOOL_OR_BYTE: return ( executorch::runtime::tensor_is_type(t, ScalarType::Bool) || diff --git a/kernels/portable/cpu/util/elementwise_util.h b/kernels/portable/cpu/util/elementwise_util.h index ae211a4cf08..3e8c3d2c6e2 100644 --- a/kernels/portable/cpu/util/elementwise_util.h +++ b/kernels/portable/cpu/util/elementwise_util.h @@ -91,6 +91,16 @@ load_to_common_fn get_load_to_common_fn_floathbf16( return result; } +template +load_to_common_fn get_load_to_common_fn_intb(const Tensor& t) { + CTYPE_COMMON (*result)(const void*) = nullptr; + ET_SWITCH_INT_TYPES_AND( + Bool, t.scalar_type(), unused, op_name, TENSOR_CTYPE, [&]() { + result = internal::load_and_convert; + }); + return result; +} + template load_to_common_fn get_load_to_common_fn_bool_or_byte( const Tensor& t) { @@ -173,6 +183,17 @@ get_store_common_to_tensor_fn_floathbf16(const Tensor& t) { return result; } +template +store_common_to_tensor_fn get_store_common_to_tensor_fn_intb( + const Tensor& t) { + void (*result)(CTYPE_COMMON, void*) = nullptr; + ET_SWITCH_INT_TYPES_AND( + Bool, t.scalar_type(), unused, op_name, TENSOR_CTYPE, [&]() { + result = internal::convert_and_store; + }); + return result; +} + template store_common_to_tensor_fn get_store_common_to_tensor_fn_bool_or_byte(const Tensor& t) { @@ -226,6 +247,7 @@ enum class SupportedTensorDtypes { REALHBBF16, REALHBF16, FLOATHBF16, + INTB, BOOL_OR_BYTE, SAME_AS_COMPUTE, SAME_AS_COMMON, @@ -244,6 +266,8 @@ load_to_common_fn get_load_to_common_fn( return get_load_to_common_fn_realhbf16(t); case SupportedTensorDtypes::FLOATHBF16: return get_load_to_common_fn_realhbf16(t); + case SupportedTensorDtypes::INTB: + return get_load_to_common_fn_intb(t); case SupportedTensorDtypes::BOOL_OR_BYTE: return get_load_to_common_fn_bool_or_byte(t); case SupportedTensorDtypes::SAME_AS_COMPUTE: @@ -266,6 +290,8 @@ store_common_to_tensor_fn get_store_common_to_tensor_fn( return get_store_common_to_tensor_fn_realhbf16(t); case SupportedTensorDtypes::FLOATHBF16: return get_store_common_to_tensor_fn_floathbf16(t); + case SupportedTensorDtypes::INTB: + return get_store_common_to_tensor_fn_intb(t); case SupportedTensorDtypes::BOOL_OR_BYTE: return get_store_common_to_tensor_fn_bool_or_byte( t); diff --git a/shim/xplat/executorch/kernels/portable/op_registration_util.bzl b/shim/xplat/executorch/kernels/portable/op_registration_util.bzl index 8f66cb4acc6..c0ceedf1fa0 100644 --- a/shim/xplat/executorch/kernels/portable/op_registration_util.bzl +++ b/shim/xplat/executorch/kernels/portable/op_registration_util.bzl @@ -322,12 +322,10 @@ ATEN_OPS = ( op_target( name = "op_bitwise_and", deps = [ - "//executorch/runtime/core/exec_aten/util:scalar_type_util", - "//executorch/runtime/core/exec_aten/util:tensor_util", + ":scalar_utils", "//executorch/kernels/portable/cpu/pattern:bitwise_op", "//executorch/kernels/portable/cpu/util:broadcast_util", - "//executorch/kernels/portable/cpu/util:functional_util", - ":scalar_utils", + "//executorch/kernels/portable/cpu/util:elementwise_util", ], ), op_target( @@ -341,23 +339,19 @@ ATEN_OPS = ( op_target( name = "op_bitwise_or", deps = [ - "//executorch/runtime/core/exec_aten/util:scalar_type_util", - "//executorch/runtime/core/exec_aten/util:tensor_util", + ":scalar_utils", "//executorch/kernels/portable/cpu/pattern:bitwise_op", "//executorch/kernels/portable/cpu/util:broadcast_util", - "//executorch/kernels/portable/cpu/util:functional_util", - ":scalar_utils", + "//executorch/kernels/portable/cpu/util:elementwise_util", ], ), op_target( name = "op_bitwise_xor", deps = [ - "//executorch/runtime/core/exec_aten/util:scalar_type_util", - "//executorch/runtime/core/exec_aten/util:tensor_util", + ":scalar_utils", "//executorch/kernels/portable/cpu/pattern:bitwise_op", "//executorch/kernels/portable/cpu/util:broadcast_util", - "//executorch/kernels/portable/cpu/util:functional_util", - ":scalar_utils", + "//executorch/kernels/portable/cpu/util:elementwise_util", ], ), op_target(