Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Tensor& add_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "add.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "add.out";

if (executorch::runtime::isComplexType(a.scalar_type()) ||
executorch::runtime::isComplexType(b.scalar_type()) ||
Expand Down Expand Up @@ -125,7 +125,7 @@ Tensor& add_scalar_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "add.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "add.Scalar_out";

ET_SWITCH_REALB_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
CTYPE_COMPUTE val_b = utils::scalar_to<CTYPE_COMPUTE>(b);
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_addmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Tensor& addmm_out(
ET_KERNEL_CHECK(ctx, tensor_is_default_dim_order(in), InvalidArgument, out);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "addmm.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "addmm.out";

ET_SWITCH_REALHBF16_TYPES(in.scalar_type(), ctx, op_name, CTYPE, [&]() {
CTYPE alpha_val = utils::scalar_to<CTYPE>(alpha);
Expand Down
3 changes: 2 additions & 1 deletion kernels/portable/cpu/op_amax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ Tensor& amax_out(
for (const auto out_ix : c10::irange(begin, end)) {
out_data[out_ix] = plan.execute<CTYPE>(
[](CTYPE v, CTYPE max_v) {
return std::isnan(v) || v > max_v ? v : max_v;
return std::isnan(static_cast<float>(v)) || v > max_v ? v
: max_v;
},
out_ix);
}
Expand Down
3 changes: 2 additions & 1 deletion kernels/portable/cpu/op_amin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ Tensor& amin_out(
for (const auto out_ix : c10::irange(begin, end)) {
out_data[out_ix] = plan.execute<CTYPE>(
[](CTYPE v, CTYPE min_v) {
return std::isnan(v) || v < min_v ? v : min_v;
return std::isnan(static_cast<float>(v)) || v < min_v ? v
: min_v;
},
out_ix);
}
Expand Down
3 changes: 2 additions & 1 deletion kernels/portable/cpu/op_argmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ Tensor& argmax_out(
// the below condition as written is equivalent to
// !isnan(accval) && (isnan(v) || v > acc_val). See
// argument in op_argmin.cpp.
if (!std::isnan(acc_val) && !(v <= acc_val)) {
if (!std::isnan(static_cast<float>(acc_val)) &&
!(v <= acc_val)) {
acc_val = v;
acc_ix = ix;
}
Expand Down
3 changes: 2 additions & 1 deletion kernels/portable/cpu/op_argmin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ Tensor& argmin_out(
// - false, so the result is true. The result is trivially
// - true for the above condition that uses isnan(v) as
// - well.
if (!std::isnan(acc_val) && !(v >= acc_val)) {
if (!std::isnan(static_cast<float>(acc_val)) &&
!(v >= acc_val)) {
acc_val = v;
acc_ix = ix;
}
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_atan2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Tensor& atan2_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "atan2.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "atan2.out";

ET_SWITCH_FLOAT_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
utils::apply_bitensor_elementwise_fn<
Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_bitwise_and.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& bitwise_and_Tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "bitwise_and.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "bitwise_and.Tensor_out";
return internal::bitwise_tensor_out<std::bit_and, op_name>(ctx, a, b, out);
}

Expand All @@ -30,7 +30,7 @@ Tensor& bitwise_and_Scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "bitwise_and.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "bitwise_and.Scalar_out";
return internal::bitwise_scalar_out<std::bit_and, op_name>(ctx, a, b, out);
}

Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_bitwise_or.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& bitwise_or_Tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "bitwise_or.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "bitwise_or.Tensor_out";
return internal::bitwise_tensor_out<std::bit_or, op_name>(ctx, a, b, out);
}

Expand All @@ -30,7 +30,7 @@ Tensor& bitwise_or_Scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "bitwise_or.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "bitwise_or.Scalar_out";
return internal::bitwise_scalar_out<std::bit_or, op_name>(ctx, a, b, out);
}

Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_bitwise_xor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& bitwise_xor_Tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "bitwise_xor.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "bitwise_xor.Tensor_out";
return internal::bitwise_tensor_out<std::bit_xor, op_name>(ctx, a, b, out);
}

Expand All @@ -30,7 +30,7 @@ Tensor& bitwise_xor_Scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "bitwise_xor.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "bitwise_xor.Scalar_out";
return internal::bitwise_scalar_out<std::bit_xor, op_name>(ctx, a, b, out);
}

Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_clamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Tensor& clamp_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "clamp.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "clamp.out";

ET_SWITCH_REALB_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
utils::apply_unitensor_elementwise_fn<
Expand Down Expand Up @@ -210,7 +210,7 @@ Tensor& clamp_tensor_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "clamp.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "clamp.Tensor_out";

ET_SWITCH_REALB_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
utils::apply_tritensor_elementwise_fn<
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ Tensor& convolution_out(
}

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char name[] = "convolution.out";
static ET_OP_NAME_SPECIFIER const char name[] = "convolution.out";

ET_SWITCH_REALH_TYPES(in.scalar_type(), ctx, name, CTYPE, [&]() {
const auto load_bias = bias.has_value()
Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Tensor& copy_out(
ctx, tensors_have_same_dim_order(in, out), InvalidArgument, out);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "copy.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "copy.out";

// Use direct copy fast path if broadcast is not needed and tensors are
// non-empty
Expand Down Expand Up @@ -86,7 +86,7 @@ Tensor& copy_(
ctx, tensors_have_same_dim_order(in, src), InvalidArgument, in);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "copy_";
static ET_OP_NAME_SPECIFIER const char op_name[] = "copy_";

// Use direct copy fast path if broadcast is not needed and tensors are
// non-empty
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_cumsum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Tensor& cumsum_out(
dim = (self.dim() == 0) ? 0 : dim < 0 ? dim + self.dim() : dim;

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "cumsum.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "cumsum.out";

ET_SWITCH_REALHBBF16_TYPES(out.scalar_type(), ctx, op_name, CTYPE_OUT, [&]() {
const auto load_self =
Expand Down
8 changes: 4 additions & 4 deletions kernels/portable/cpu/op_div.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Tensor& div_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "div.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "div.out";

ET_SWITCH_FLOAT_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
utils::apply_bitensor_elementwise_fn<
Expand Down Expand Up @@ -116,7 +116,7 @@ Tensor& div_out_mode(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "div.out_mode";
static ET_OP_NAME_SPECIFIER const char op_name[] = "div.out_mode";

const bool mode_is_trunc = mode_val == "trunc";
bool div_by_zero_error = false;
Expand Down Expand Up @@ -187,7 +187,7 @@ Tensor& div_scalar_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "div.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "div.Scalar_out";

ET_SWITCH_FLOAT_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
const CTYPE_COMPUTE val_b = utils::scalar_to<CTYPE_COMPUTE>(b);
Expand Down Expand Up @@ -255,7 +255,7 @@ Tensor& div_scalar_mode_out(
const bool mode_is_trunc = mode_val == "trunc";

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "div.Scalar_mode_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "div.Scalar_mode_out";

ET_SWITCH_REAL_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
const CTYPE_COMPUTE val_b = utils::scalar_to<CTYPE_COMPUTE>(b);
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_elu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Tensor& elu_out(

ET_KERNEL_CHECK(ctx, tensors_have_same_dtype(in, out), InvalidArgument, out);

static constexpr const char op_name[] = "elu.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "elu.out";
ET_SWITCH_FLOATHBF16_TYPES(in.scalar_type(), ctx, op_name, CTYPE, [&]() {
using MathT = std::
conditional_t<c10::is_reduced_floating_point_v<CTYPE>, float, CTYPE>;
Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_eq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& eq_tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "eq.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "eq.Tensor_out";
return internal::comparison_tensor_out<std::equal_to, op_name>(
ctx, a, b, out);
}
Expand All @@ -31,7 +31,7 @@ Tensor& eq_scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "eq.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "eq.Scalar_out";
return internal::comparison_scalar_out<std::equal_to, op_name>(
ctx, a, b, out);
}
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_floor_divide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Tensor& floor_divide_out(
ScalarType compute_type = utils::get_compute_type(common_type);

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "floor_divide.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "floor_divide.out";

bool div_by_zero_error = false;

Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_fmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Tensor& fmod_Tensor_out(
}

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "fmod.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "fmod.Tensor_out";

bool div_by_zero_error = false;

Expand Down Expand Up @@ -130,7 +130,7 @@ Tensor& fmod_Scalar_out(
}

// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "fmod.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "fmod.Scalar_out";

ET_SWITCH_FLOAT_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
const CTYPE_COMPUTE val_b = utils::scalar_to<CTYPE_COMPUTE>(b);
Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_ge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& ge_tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "ge.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "ge.Tensor_out";
return internal::comparison_tensor_out<std::greater_equal, op_name>(
ctx, a, b, out);
}
Expand All @@ -31,7 +31,7 @@ Tensor& ge_scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "ge.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "ge.Scalar_out";
return internal::comparison_scalar_out<std::greater_equal, op_name>(
ctx, a, b, out);
}
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_glu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Tensor& glu_out_tensor(
? self.scalar_type()
: ScalarType::Float;
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "glu.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "glu.out";
ET_SWITCH_FLOATHBF16_TYPES(compute_type, ctx, op_name, CTYPE_COMPUTE, [&]() {
utils::apply_bitensor_elementwise_fn<
CTYPE_COMPUTE,
Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_gt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& gt_tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "gt.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "gt.Tensor_out";
return internal::comparison_tensor_out<std::greater, op_name>(ctx, a, b, out);
}

Expand All @@ -30,7 +30,7 @@ Tensor& gt_scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "gt.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "gt.Scalar_out";
return internal::comparison_scalar_out<std::greater, op_name>(ctx, a, b, out);
}

Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_le.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& le_tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "le.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "le.Tensor_out";
return internal::comparison_tensor_out<std::less_equal, op_name>(
ctx, a, b, out);
}
Expand All @@ -31,7 +31,7 @@ Tensor& le_scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "le.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "le.Scalar_out";
return internal::comparison_scalar_out<std::less_equal, op_name>(
ctx, a, b, out);
}
Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_logical_and.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Tensor& logical_and_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "logical_and.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "logical_and.out";
return internal::logical_tensor_out<op_name>(logical_and, ctx, a, b, out);
}

Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_logical_or.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Tensor& logical_or_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "logical_or.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "logical_or.out";
return internal::logical_tensor_out<op_name>(logical_or, ctx, a, b, out);
}

Expand Down
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_logical_xor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Tensor& logical_xor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "logical_xor.out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "logical_xor.out";
return internal::logical_tensor_out<op_name>(logical_xor, ctx, a, b, out);
}

Expand Down
4 changes: 2 additions & 2 deletions kernels/portable/cpu/op_lt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tensor& lt_tensor_out(
const Tensor& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "lt.Tensor_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "lt.Tensor_out";
return internal::comparison_tensor_out<std::less, op_name>(ctx, a, b, out);
}

Expand All @@ -30,7 +30,7 @@ Tensor& lt_scalar_out(
const Scalar& b,
Tensor& out) {
// @lint-ignore CLANGTIDY facebook-hte-CArray
static constexpr const char op_name[] = "lt.Scalar_out";
static ET_OP_NAME_SPECIFIER const char op_name[] = "lt.Scalar_out";
return internal::comparison_scalar_out<std::less, op_name>(ctx, a, b, out);
}

Expand Down
Loading
Loading