this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement vDSP_maxmgv, vDSP_vsadd (#733)

+90 -2
+2 -1
src/frameworks/Accelerate/vecLib/vDSP/CMakeLists.txt
··· 5 5 set(DYLIB_CURRENT_VERSION "671.250.4") 6 6 7 7 add_darling_library(vDSP SHARED 8 - src/vDSP.c 8 + src/vDSP.c 9 + src/extrema.c 9 10 ) 10 11 make_fat(vDSP) 11 12 target_link_libraries(vDSP system)
+3 -1
src/frameworks/Accelerate/vecLib/vDSP/include/vDSP/vDSP.h
··· 21 21 #ifndef _vDSP_H_ 22 22 #define _vDSP_H_ 23 23 24 + typedef unsigned long vDSP_Length; 25 + typedef long vDSP_Stride; 26 + 24 27 void* vDSP_DCT_CreateSetup(void); 25 28 void* vDSP_DCT_Execute(void); 26 29 void* vDSP_DFT_CreateSetup(void); ··· 144 147 void* vDSP_hann_windowD(void); 145 148 void* vDSP_imgfir(void); 146 149 void* vDSP_imgfirD(void); 147 - void* vDSP_maxmgv(void); 148 150 void* vDSP_maxmgvD(void); 149 151 void* vDSP_maxmgvi(void); 150 152 void* vDSP_maxmgviD(void);
+36
src/frameworks/Accelerate/vecLib/vDSP/src/basic.c
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #include <vDSP/vDSP.h> 21 + 22 + void vDSP_vsadd(const float *__A, vDSP_Stride __IA, const float *__B, float *__C, vDSP_Stride __IC, vDSP_Length __N) 23 + { 24 + if (__IA == 1 && __IC == 1) 25 + { 26 + #pragma clang loop vectorize(enable) 27 + for (vDSP_Length i = 0; i < __N; i++) 28 + __C[i] = __A[i] + __B[i]; 29 + } 30 + else 31 + { 32 + #pragma clang loop vectorize(enable) 33 + for (vDSP_Length i = 0; i < __N; i++) 34 + __C[i * __IC] = __A[i * __IA] + __B[i * __IA]; 35 + } 36 + }
+45
src/frameworks/Accelerate/vecLib/vDSP/src/extrema.c
··· 1 + /* 2 + This file is part of Darling. 3 + 4 + Copyright (C) 2020 Lubos Dolezel 5 + 6 + Darling is free software: you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation, either version 3 of the License, or 9 + (at your option) any later version. 10 + 11 + Darling is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #include <vDSP/vDSP.h> 21 + #include <math.h> 22 + 23 + void vDSP_maxmgv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N) 24 + { 25 + *__C = -INFINITY; 26 + 27 + if (__N != 1) 28 + { 29 + #pragma clang loop vectorize(enable) 30 + for (vDSP_Length i = 0; i < __N; i++) 31 + { 32 + if (*__C < fabsf(__A[i * __IA])) 33 + *__C = fabsf(__A[i * __IA]); 34 + } 35 + } 36 + else 37 + { 38 + #pragma clang loop vectorize(enable) 39 + for (vDSP_Length i = 0; i < __N; i++) 40 + { 41 + if (*__C < fabsf(__A[i])) 42 + *__C = fabsf(__A[i]); 43 + } 44 + } 45 + }
+4
src/frameworks/Accelerate/vecLib/vDSP/src/vDSP.c
··· 767 767 return NULL; 768 768 } 769 769 770 + /* 770 771 void* vDSP_maxmgv(void) 771 772 { 772 773 if (verbose) puts("STUB: vDSP_maxmgv called"); 773 774 return NULL; 774 775 } 776 + */ 775 777 776 778 void* vDSP_maxmgvD(void) 777 779 { ··· 1991 1993 return NULL; 1992 1994 } 1993 1995 1996 + /* 1994 1997 void* vDSP_vsadd(void) 1995 1998 { 1996 1999 if (verbose) puts("STUB: vDSP_vsadd called"); 1997 2000 return NULL; 1998 2001 } 2002 + */ 1999 2003 2000 2004 void* vDSP_vsaddD(void) 2001 2005 {