Optimized Belief Propagation (CPU and GPU)
ARMTemplateSpFuncts.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2024 Scott Grauer-Gray
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 
27 #ifndef ARMTEMPLATESPFUNCTS_H_
28 #define ARMTEMPLATESPFUNCTS_H_
29 
30 #include "RunImp/UtilityFuncts.h"
31 
32 #if defined(COMPILING_FOR_ARM)
33 
34 #include <arm_neon.h>
35 
36 template<> inline
37 float16_t util_functs::ZeroVal<float16_t>()
38 {
39  return (float16_t)0.0f;
40 }
41 
42 template<> inline
43 float util_functs::ConvertValToDifferentDataTypeIfNeeded<float16_t, float>(
44  float16_t valToConvert)
45 {
46  return (float)valToConvert;
47 }
48 
49 template<> inline
50 float16_t util_functs::ConvertValToDifferentDataTypeIfNeeded<float, float16_t>(
51  float valToConvert)
52 {
53  //seems like simple cast function works
54  return (float16_t)valToConvert;
55 }
56 
57 #endif //COMPILING_FOR_ARM
58 
59 #endif /* ARMTEMPLATESPFUNCTS_H_ */
Contains namespace with utility functions for implementation.