File tree Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -91,3 +91,4 @@ benchmark/*.goto
91
91
benchmark /smallscaling
92
92
CMakeCache.txt
93
93
CMakeFiles /*
94
+ .vscode
Original file line number Diff line number Diff line change @@ -212,7 +212,8 @@ Please note that it is not possible to combine support for different architectur
212
212
- ** Android** : Supported by the community. Please read < https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-Android > .
213
213
- ** AIX** : Supported on PPC up to POWER8
214
214
- ** Haiku** : Supported by the community. We don't actively test the library on this OS.
215
- - ** SunOS** : Supported by the community. We don't actively test the library on this OS:
215
+ - ** SunOS** : Supported by the community. We don't actively test the library on this OS.
216
+ - ** Cortex-M** : Supported by the community. Please read < https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-on-Cortex-M > .
216
217
217
218
## Usage
218
219
Original file line number Diff line number Diff line change @@ -233,6 +233,11 @@ if (BINARY64)
233
233
endif ()
234
234
endif ()
235
235
236
+ if (EMBEDDED )
237
+ set (CCOMMON_OPT "${CCOMMON_OPT} -DOS_EMBEDDED" )
238
+ set (CCOMMON_OPT "${CCOMMON_OPT} -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16" )
239
+ endif ()
240
+
236
241
if (NEED_PIC )
237
242
if (${CMAKE_C_COMPILER} STREQUAL "IBM" )
238
243
set (CCOMMON_OPT "${CCOMMON_OPT} -qpic=large" )
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ extern "C" {
122
122
#define ATOM GOTO_ATOM
123
123
#undef GOTO_ATOM
124
124
#endif
125
- #else
125
+ #elif !defined( OS_EMBEDDED )
126
126
#include <sys/mman.h>
127
127
#ifndef NO_SYSV_IPC
128
128
#include <sys/shm.h>
@@ -134,6 +134,9 @@ extern "C" {
134
134
#if defined(SMP ) || defined(USE_LOCKING )
135
135
#include <pthread.h>
136
136
#endif
137
+ #else
138
+ #include <time.h>
139
+ #include <math.h>
137
140
#endif
138
141
139
142
#if defined(OS_SUNOS )
@@ -488,10 +491,12 @@ static inline unsigned long long rpcc(void){
488
491
struct timespec ts ;
489
492
clock_gettime (CLOCK_MONOTONIC , & ts );
490
493
return (unsigned long long )ts .tv_sec * 1000000000ull + ts .tv_nsec ;
491
- #else
494
+ #elif !defined( OS_EMBEDDED )
492
495
struct timeval tv ;
493
496
gettimeofday (& tv ,NULL );
494
497
return (unsigned long long )tv .tv_sec * 1000000000ull + tv .tv_usec * 1000 ;
498
+ #else
499
+ return 0 ;
495
500
#endif
496
501
}
497
502
#define RPCC_DEFINED
@@ -521,6 +526,10 @@ static void __inline blas_lock(volatile BLASULONG *address){
521
526
#include "common_linux.h"
522
527
#endif
523
528
529
+ #ifdef OS_EMBEDDED
530
+ #define DTB_DEFAULT_ENTRIES 64
531
+ #endif
532
+
524
533
#define MMAP_ACCESS (PROT_READ | PROT_WRITE)
525
534
526
535
#ifdef __NetBSD__
Original file line number Diff line number Diff line change @@ -1668,16 +1668,23 @@ void gotoblas_dummy_for_PGI(void) {
1668
1668
#ifndef MEM_LARGE_PAGES
1669
1669
#define MEM_LARGE_PAGES 0x20000000
1670
1670
#endif
1671
- #else
1671
+ #elif !defined( OS_EMBEDDED )
1672
1672
#define ALLOC_MMAP
1673
1673
#define ALLOC_MALLOC
1674
+ #else
1675
+ #define ALLOC_MALLOC
1676
+
1677
+ inline int puts (const char * str ) { return 0 ; }
1678
+ inline int printf (const char * format , ...) { return 0 ; }
1679
+ inline char * getenv (const char * name ) { return "" ; }
1680
+ inline int atoi (const char * str ) { return 0 ; }
1674
1681
#endif
1675
1682
1676
1683
#include <stdlib.h>
1677
1684
#include <stdio.h>
1678
1685
#include <fcntl.h>
1679
1686
1680
- #if !defined(OS_WINDOWS ) || defined(OS_CYGWIN_NT )
1687
+ #if ( !defined(OS_WINDOWS ) || defined(OS_CYGWIN_NT )) && !defined( OS_EMBEDDED )
1681
1688
#include <sys/mman.h>
1682
1689
#ifndef NO_SYSV_IPC
1683
1690
#include <sys/shm.h>
You can’t perform that action at this time.
0 commit comments