diff --git a/Include/arm_math_types_f16.h b/Include/arm_math_types_f16.h index 92939b14..a36c2c52 100755 --- a/Include/arm_math_types_f16.h +++ b/Include/arm_math_types_f16.h @@ -134,13 +134,13 @@ won't be built. #if defined(ARM_FLOAT16_SUPPORTED) -#define F16_MAX ((float16_t)FLT_MAX) -#define F16_MIN (-(float16_t)FLT_MAX) +#define F16_MAX ((float16_t)__FLT16_MAX__) +#define F16_MIN (-(float16_t)__FLT16_MAX__) -#define F16_ABSMAX ((float16_t)FLT_MAX) -#define F16_ABSMIN ((float16_t)0.0) +#define F16_ABSMAX ((float16_t)__FLT16_MAX__) +#define F16_ABSMIN ((float16_t)0.0f16) -#define F16INFINITY ((float16_t)0x07c00) +#define F16INFINITY ((float16_t)__builtin_inf()) #endif /* ARM_FLOAT16_SUPPORTED*/ #endif /* !defined( __CC_ARM ) */ diff --git a/Include/dsp/svm_defines.h b/Include/dsp/svm_defines.h new file mode 100755 index 00000000..71ad2f73 --- /dev/null +++ b/Include/dsp/svm_defines.h @@ -0,0 +1,42 @@ +/****************************************************************************** + * @file svm_defines.h + * @brief Public header file for CMSIS DSP Library + ******************************************************************************/ +/* + * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef _SVM_DEFINES_H_ +#define _SVM_DEFINES_H_ + +/** + * @brief Struct for specifying SVM Kernel + */ +typedef enum +{ + ARM_ML_KERNEL_LINEAR = 0, + /**< Linear kernel */ + ARM_ML_KERNEL_POLYNOMIAL = 1, + /**< Polynomial kernel */ + ARM_ML_KERNEL_RBF = 2, + /**< Radial Basis Function kernel */ + ARM_ML_KERNEL_SIGMOID = 3 + /**< Sigmoid kernel */ +} arm_ml_kernel_type; + +#endif diff --git a/Include/dsp/svm_functions.h b/Include/dsp/svm_functions.h index ac99fafb..c50deb55 100755 --- a/Include/dsp/svm_functions.h +++ b/Include/dsp/svm_functions.h @@ -31,6 +31,7 @@ #include "dsp/none.h" #include "dsp/utils.h" +#include "dsp/svm_defines.h" #ifdef __cplusplus extern "C" @@ -73,20 +74,7 @@ __STATIC_INLINE float32_t arm_exponent_f32(float32_t x, int32_t nb) } -/** - * @brief Struct for specifying SVM Kernel - */ -typedef enum -{ - ARM_ML_KERNEL_LINEAR = 0, - /**< Linear kernel */ - ARM_ML_KERNEL_POLYNOMIAL = 1, - /**< Polynomial kernel */ - ARM_ML_KERNEL_RBF = 2, - /**< Radial Basis Function kernel */ - ARM_ML_KERNEL_SIGMOID = 3 - /**< Sigmoid kernel */ -} arm_ml_kernel_type; + /** diff --git a/Include/dsp/svm_functions_f16.h b/Include/dsp/svm_functions_f16.h index 95909db3..f670d327 100755 --- a/Include/dsp/svm_functions_f16.h +++ b/Include/dsp/svm_functions_f16.h @@ -31,6 +31,7 @@ #include "dsp/none.h" #include "dsp/utils.h" +#include "dsp/svm_defines.h" #ifdef __cplusplus extern "C" @@ -75,22 +76,6 @@ __STATIC_INLINE float16_t arm_exponent_f16(float16_t x, int32_t nb) } -/** - * @brief Struct for specifying SVM Kernel - */ -typedef enum -{ - ARM_ML_KERNEL_LINEAR = 0, - /**< Linear kernel */ - ARM_ML_KERNEL_POLYNOMIAL = 1, - /**< Polynomial kernel */ - ARM_ML_KERNEL_RBF = 2, - /**< Radial Basis Function kernel */ - ARM_ML_KERNEL_SIGMOID = 3 - /**< Sigmoid kernel */ -} arm_ml_kernel_type; - - /** * @brief Instance structure for linear SVM prediction function. */