File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.10 )
1
+ cmake_minimum_required (VERSION 3.20 )
2
2
project (cfmm)
3
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
4
+ add_definitions (-DUSE_ACCELERATE)
5
+ add_definitions (-DACCELERATE_NEW_LAPACK)
6
+ endif ()
7
+
3
8
4
9
set (CMAKE_C_STANDARD 11)
5
10
set (CMAKE_C_STANDARD_REQUIRED 11)
@@ -19,7 +24,6 @@ add_compile_options(-O3)
19
24
add_compile_options (-march=native)
20
25
add_compile_options (-D_GNU_SOURCE)
21
26
22
-
23
27
# set(JEMALLOC_ROOT "/opt/homebrew/Cellar/jemalloc/5.3.0")
24
28
# # Add jemalloc include directory
25
29
# include_directories("${JEMALLOC_ROOT}/include")
@@ -34,6 +38,9 @@ target_include_directories(${PROJECT_NAME} PRIVATE
34
38
)
35
39
set_source_files_properties ("${CMAKE_CURRENT_SOURCE_DIR} /main.c" PROPERTIES COMPILE_FLAGS "-O1" )
36
40
41
+ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
42
+ target_compile_definitions (${PROJECT_NAME} PRIVATE ACCELERATE_NEW_LAPACK)
43
+ endif ()
37
44
include (FindBLAS)
38
45
39
46
if (BLAS_FOUND)
Original file line number Diff line number Diff line change 5
5
#include <stdlib.h>
6
6
#include <string.h>
7
7
#include <math.h>
8
+ #ifdef USE_ACCELERATE
9
+ #include "cblas_new.h"
10
+ #else
8
11
#include "cblas.h"
12
+ #endif
9
13
10
14
struct int_cmat {
11
15
int * arena ; // keep all the data in one arena
Original file line number Diff line number Diff line change 2
2
#define MATMUL_H
3
3
4
4
#include "cmat.h"
5
+ #ifdef USE_ACCELERATE
6
+ #include "cblas_new.h"
7
+ #else
5
8
#include "cblas.h"
9
+ #endif
6
10
7
11
int matmul_float (float_cmat matA , float_cmat matB , float_cmat matC );
8
12
You can’t perform that action at this time.
0 commit comments