Skip to content
Merged
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
2 changes: 1 addition & 1 deletion backends/cadence/fusion_g3/operators/op_add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Tensor& add_out(
float alpha_val;
torch::executor::native::utils::extract_scalar(alpha, &alpha_val);

if ((a.numel() == 1) && (alpha_val == 1.0)) {
if ((a.numel() == 1) && (alpha_val == 1.0f)) {
XT_KERNEL_CHECK(
ctx,
out,
Expand Down
8 changes: 4 additions & 4 deletions backends/cadence/hifi/kernels/kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void* allocate_temp_memory(KernelRuntimeContext& ctx, size_t size) {
template <typename T>
__attribute__((always_inline)) T
quantize(const float x, float scale, int32_t zero_point) {
constexpr float min_val = std::numeric_limits<T>::min();
constexpr float max_val = std::numeric_limits<T>::max();
constexpr float min_val = static_cast<float>(std::numeric_limits<T>::min());
constexpr float max_val = static_cast<float>(std::numeric_limits<T>::max());
float tmp = roundf(x * scale + zero_point);
return std::max(std::min(tmp, max_val), min_val);
}
Expand All @@ -56,8 +56,8 @@ void quantize(
xtfloatx2 scale_vec = (xtfloatx2)scale;
xtfloatx2 zero_vec = XT_FLOAT_SX2(zero_point, 0);

constexpr float min_val = std::numeric_limits<T>::min();
constexpr float max_val = std::numeric_limits<T>::max();
constexpr float min_val = static_cast<float>(std::numeric_limits<T>::min());
constexpr float max_val = static_cast<float>(std::numeric_limits<T>::max());

const xtfloatx2* __restrict__ p0 = (const xtfloatx2* __restrict__)x;
ae_valign va0 = XT_LASX2PP(p0);
Expand Down
8 changes: 4 additions & 4 deletions backends/cadence/hifi/operators/op_quantized_relu_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#include <executorch/backends/cadence/hifi/kernels/kernels.h>
#include <executorch/runtime/kernel/kernel_includes.h>

using executorch::aten::ScalarType;
using executorch::aten::Tensor;
using torch::executor::KernelRuntimeContext;

namespace impl {
namespace HiFi {
namespace native {

using ::executorch::aten::ScalarType;
using ::executorch::aten::Tensor;
using ::executorch::runtime::KernelRuntimeContext;

void quantized_relu_per_tensor_out(
KernelRuntimeContext& ctx,
const Tensor& input,
Expand Down
4 changes: 4 additions & 0 deletions backends/cadence/hifi/third-party/nnlib/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def define_common_targets():
"@EXECUTORCH_CLIENTS",
],
compatible_with = ["ovr_config//cpu:xtensa"],
compiler_flags = [
"-Wno-pointer-sign",
"-Wno-incompatible-pointer-types-discards-qualifiers",
],
deps = [
"fbsource//third-party/nnlib-hifi4/xa_nnlib:libxa_nnlib",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
******************************************************************************/
#include <float.h>

#include "../include/NatureDSP_Signal_math.h"
#include "NatureDSP_Signal_math.h"
#include "NatureDSP_types.h"
#include "xa_nn_common.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

******************************************************************************/

#include "../include/NatureDSP_Signal_math.h"
#include "NatureDSP_Signal_math.h"
#include "NatureDSP_types.h"
#include "xa_nn_common.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ WORD32 xa_nn_elm_where_f32xf32_f32(FLOAT32 * __restrict__ p_out,
XT_MOVF_S(a, a2, s);
XT_SSI(a, (xtfloat *)out, 0);
}
return 0;
}

static void internal_elm_where_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p_out,
Expand Down
Loading