forked from giaf/blasfeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
1167 lines (942 loc) · 44.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
###################################################################################################
# #
# This file is part of BLASFEO. #
# #
# BLASFEO -- BLAS For Embedded Optimization. #
# Copyright (C) 2019 by Gianluca Frison. #
# Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. #
# All rights reserved. #
# #
# The 2-Clause BSD License #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR #
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES #
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND #
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
# Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de #
# #
###################################################################################################
cmake_minimum_required(VERSION 2.8.11)
# installation directory ( has to be before `project()` )
set(CMAKE_INSTALL_PREFIX "/opt/blasfeo" CACHE STRING "Installation path")
project(blasfeo C ASM)
set(CMAKE_VERBOSE_MAKEFILE ON)
# enable_language(C ASM)
# Target architecture
# set(TARGET X64_AUTOMATIC CACHE STRING "Target architecture")
# set(TARGET X64_INTEL_HASWELL CACHE STRING "Target architecture")
# set(TARGET X64_INTEL_SANDY_BRIDGE CACHE STRING "Target architecture")
# set(TARGET X64_INTEL_CORE CACHE STRING "Target architecture")
# set(TARGET X64_AMD_BULLDOZER CACHE STRING "Target architecture")
# set(TARGET ARMV8A_ARM_CORTEX_A57 CACHE STRING "Target architecture")
# set(TARGET ARMV8A_ARM_CORTEX_A53 CACHE STRING "Target architecture")
# set(TARGET ARMV7A_ARM_CORTEX_A15 CACHE STRING "Target architecture")
# set(TARGET ARMV7A_ARM_CORTEX_A9 CACHE STRING "Target architecture")
# set(TARGET ARMV7A_ARM_CORTEX_A7 CACHE STRING "Target architecture")
set(TARGET GENERIC CACHE STRING "Target architecture")
# Select back-end linear lagebra version (LA) to implement BLASFEO API:
# HIGH_PERFORMANCE : target-tailored; performance-optimized for cache resident matrices; panel-major matrix format
# REFERENCE : target-unspecific lightly-optimized; small code footprint; {panel,column}-major matrix format(s)
# EXTERNAL_BLAS_WRAPPER : call to external BLAS and LAPACK libraries; column-major matrix format
set(LA HIGH_PERFORMANCE CACHE STRING "Linear algebra backend")
# set(LA REFERENCE CACHE STRING "Linear algebra backend")
# set(LA BLAS CACHE STRING "Linear algebra backend")
# Export additional back-ends with different naming
set(BLASFEO_REF_API OFF)
set(BLASFEO_HP_API OFF)
# Select the Matrix Format internally used in the blasfeo_{d,s}mat structure
# COLMAJ : column-major matrix format
# PANELMAJ : panel-major matrix format
# set(MF COLMAJ CACHE STRING "Matrix Format internally used in blasfeo_{d,s}mat struct")
set(MF PANELMAJ CACHE STRING "Matrix Format internally used in blasfeo_{d,s}mat struct")
# Compile the BLAS API routines provided by BLASFEO
set(BLAS_API ON CACHE BOOL "Compile BLAS API")
#set(BLAS_API OFF CACHE BOOL "Compile BLAS API")
# Export standard FORTRAN namings for BLAS API routines
# OFF : routines namings are in the form blasfeo_dgemm
# ON : routines namings are in the form dgemm_
set(FORTRAN_BLAS_API OFF CACHE BOOL "Standard fortran BLAS API")
# BLAS and LAPACK version (for LA=BLAS in BLASFEO or for BLASFEO_BENCHMARS=ON)
set(EXTERNAL_BLAS 0 CACHE STRING "Reference blas to use")
# set(EXTERNAL_BLAS OPENBLAS CACHE STRING "Reference blas to use")
# set(EXTERNAL_BLAS NETLIB CACHE STRING "Reference blas to use")
# set(EXTERNAL_BLAS MKL CACHE STRING "Reference blas to use")
# set(EXTERNAL_BLAS BLIS CACHE STRING "Reference blas to use")
# set(EXTERNAL_BLAS ATLAS CACHE STRING "Reference blas to use")
# set(EXTERNAL_BLAS ARMPL CACHE STRING "Reference blas to use")
# Stack buffer size (malloc for larger)
set(K_MAX_STACK 300 CACHE STRING "Maximum k value using stack memory")
# Macro level (code size vs performance in assembly kernels): 0 (no macro),
# 1 (all macro but gemm kernel), 2 (all macro)
set(MACRO_LEVEL 1)
# Use C99 extension to math library
set(USE_C99_MATH ON CACHE BOOL "Use C99 extension to math library")
# Compile auxiliary functions with external dependencies
# (for memory allocation and printing)
set(EXT_DEP ON CACHE BOOL "Compile external dependencies in BLASFEO")
# Options
# enable runtine checks
set(RUNTIME_CHECKS OFF)
# set(BLASFEO_TESTING ON CACHE BOOL "Tests enabled")
set(BLASFEO_TESTING OFF CACHE BOOL "Tests disabled")
# set(BLASFEO_BENCHMARKS ON CACHE BOOL "Benchmarks enabled")
set(BLASFEO_BENCHMARKS OFF CACHE BOOL "Benchmarks disabled")
set(BLASFEO_EXAMPLES ON CACHE BOOL "Examples enabled")
# set(BLASFEO_EXAMPLES OFF CACHE BOOL "Examples disabled")
# build shared library
set(BUILD_SHARED_LIBS OFF CACHE STRING "Build shared libraries")
# headers installation directory
set(BLASFEO_HEADERS_INSTALLATION_DIRECTORY "include" CACHE STRING "Headers local installation directory")
# Populate a list of allowable targets and link it to the option
set(ALLOWED_TARGETS
X64_AUTOMATIC
X64_INTEL_HASWELL
X64_INTEL_SANDY_BRIDGE
X64_INTEL_CORE
X64_AMD_BULLDOZER
ARMV8A_ARM_CORTEX_A57
ARMV8A_ARM_CORTEX_A53
ARMV7A_ARM_CORTEX_A15
ARMV7A_ARM_CORTEX_A9
ARMV7A_ARM_CORTEX_A7
GENERIC
)
set_property(CACHE TARGET PROPERTY STRINGS ${ALLOWED_TARGETS})
# This list contains the targets to try when the user sets the target to
# X64_AUTOMATIC. The order they appear in this list is the order in which
# they are tested, and the first working (both compile and run) will be
# selected for use
set(X64_AUTOMATIC_TARGETS
X64_INTEL_HASWELL
X64_AMD_BULLDOZER
X64_INTEL_SANDY_BRIDGE
X64_INTEL_CORE
GENERIC
)
list(FIND ALLOWED_TARGETS ${TARGET} isvalid)
if(${isvalid} EQUAL -1)
message(FATAL_ERROR "Target ${TARGET} is not supported")
endif()
# Populate the list of allowed LA backends and link it to the option
set(ALLOWED_BACKENDS
HIGH_PERFORMANCE
REFERENCE
BLAS
)
set_property(CACHE LA PROPERTY STRINGS ${ALLOWED_BACKENDS})
list(FIND ALLOWED_BACKENDS ${LA} isvalid)
if(${isvalid} EQUAL -1)
message(FATAL_ERROR "LA backend ${LA} is not supported")
endif()
# Populate the list of allowed Matrix Formats and link it to the option
set(ALLOWED_MATRIX_FORMAT
COLMAJ
PANELMAJ
)
set_property(CACHE MF PROPERTY STRINGS ${ALLOWED_MATRIX_FORMAT})
list(FIND ALLOWED_MATRIX_FORMAT ${MF} isvalid)
if(${isvalid} EQUAL -1)
message(FATAL_ERROR "Matrix Format ${MF} is not supported")
endif()
if(${LA} MATCHES HIGH_PERFORMANCE)
if(${BLASFEO_REF_API})
if(${MF} MATCHES COLMAJ)
message(FATAL_ERROR "As of now, with LA=HIGH_PERFORMANCE only MF=PANELMAJ is supported for the additional BLASFEO_REF_API")
endif()
endif()
endif()
# Populate the list of allowed exernal BLAS tools and link it to the option
set(ALLOWED_EXTERNAL_BLAS
0
OPENBLAS
NETLIB
MKL
BLIS
ATLAS
ARMPL
)
set_property(CACHE EXTERNAL_BLAS PROPERTY STRINGS ${ALLOWED_EXTERNAL_BLAS})
list(FIND ALLOWED_EXTERNAL_BLAS ${EXTERNAL_BLAS} isvalid)
if(${isvalid} EQUAL -1)
message(FATAL_ERROR "External BLAS ${EXTERNAL_BLAS} is not supported")
endif()
# Pass the allowed items up to the parent scope (if there is one)
# This is detected by comparing the project name to the one set earlier in this file
if(NOT ${CMAKE_PROJECT_NAME} STREQUAL blasfeo)
set(BLASFEO_ALLOWED_TARGETS ${ALLOWED_TARGETS} PARENT_SCOPE)
set(BLASFEO_ALLOWED_BACKENDS ${ALLOWED_BACKENDS} PARENT_SCOPE)
set(BLASFEO_ALLOWED_EXTERNAL_BLAS ${ALLOWED_EXTERNAL_BLAS} PARENT_SCOPE)
endif()
if(NOT DEFINED(BLASFEO_CROSSCOMPILING))
set(BLASFEO_CROSSCOMPILING ${CMAKE_CROSSCOMPILING})
endif()
# Skip BLASFEO examples for unsupported systems and for Realease build
if(CMAKE_SYSTEM MATCHES "dSpace") # OR CMAKE_BUILD_TYPE MATCHES "Release")
set(BLASFEO_TESTING OFF CACHE BOOL "Examples disabled" FORCE)
set(BLASFEO_BENCHMARKS OFF CACHE BOOL "Benchmarks disabled" FORCE)
set(BLASFEO_EXAMPLES OFF CACHE BOOL "Examples disabled" FORCE)
endif()
# C Compiler
# set(CC_COMPILER gcc CACHE STRING "compiler")
# set(CC_COMPILER clang)
# set(CC_COMPILER x86_64-w64-mingw32-gcc)
# set(CMAKE_C_COMPILER clang)
if(CMAKE_C_COMPILER_ID MATCHES MSVC)
if(NOT ${TARGET} MATCHES GENERIC)
message( FATAL_ERROR "MSVC compiler only supported for TARGET=GENERIC")
endif()
endif()
# testing
#if(BLASFEO_TESTING MATCHES ON)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTESTING_MODE=1")
#endif()
# search directories
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${BLASFEO_PATH}/include")
# Specify the linear algebra backend to use
message(STATUS "Using linear algebra: ${LA}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLA_${LA}")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DLA_${LA}")
if(${BLASFEO_REF_API})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBLASREF_REF_API")
endif()
# Specify the matrix format to use
message(STATUS "Using matrix format: ${MF}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMF_${MF}")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DMF_${MF}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DK_MAX_STACK=${K_MAX_STACK}")
#
if(${BLAS_API})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBLAS_API")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DBLAS_API")
if(${FORTRAN_BLAS_API})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFORTRAN_BLAS_API")
endif()
endif()
#
if(${RUNTIME_CHECKS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDIM_CHECK")
endif()
#
if(${USE_C99_MATH})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_C99_MATH")
endif()
#
if(${EXT_DEP})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DEXT_DEP")
endif()
#
if(${MACRO_LEVEL} MATCHES 1)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DMACRO_LEVEL=1")
endif()
if(${MACRO_LEVEL} MATCHES 2)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DMACRO_LEVEL=2")
endif()
# Detect the host system
if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOS_LINUX")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DOS_LINUX")
endif()
if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOS_MAC")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DOS_MAC")
endif()
if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOS_WINDOWS")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DOS_WINDOWS")
if(${BUILD_SHARED_LIBS} MATCHES ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
endif()
# External BLAS flags
set(C_FLAGS_BLAS_0 "-DEXTERNAL_BLAS_NONE")
set(C_FLAGS_BLAS_OPENBLAS "-DEXTERNAL_BLAS_OPENBLAS -I/opt/openblas/include")
set(C_FLAGS_BLAS_BLIS "-DEXTERNAL_BLAS_BLIS -std=gnu99 -I/opt/blis/include/blis")
set(C_FLAGS_BLAS_NETLIB "-DEXTERNAL_BLAS_NETLIB -I/opt/netlib/include")
set(C_FLAGS_BLAS_MKL "-DEXTERNAL_BLAS_MKL -std=c99 -m64 -DMKL_DIRECT_CALL_SEQ -I/opt/intel/mkl/include")
set(C_FLAGS_BLAS_ATLAS "-DEXTERNAL_BLAS_ATLAS")
set(C_FLAGS_BLAS_ARMPL "-DEXTERNAL_BLAS_ARMPL -I/opt/arm/armpl_20.3_gcc-7.1/include")
message(STATUS "Using external BLAS: ${EXTERNAL_BLAS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_BLAS_${EXTERNAL_BLAS}}")
# common C flags
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
if(NOT CMAKE_C_SIMULATE_ID MATCHES "MSVC") # See https://stackoverflow.com/questions/49480535
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") # Windows is always position independent code
endif()
endif()
# architecture-specific C flags
set(C_FLAGS_TARGET_X64_INTEL_HASWELL "-m64 -mavx -mavx2 -mfma")
set(C_FLAGS_TARGET_X64_INTEL_SANDY_BRIDGE "-m64 -mavx")
set(C_FLAGS_TARGET_X64_INTEL_CORE "-m64 -msse3")
set(C_FLAGS_TARGET_X64_AMD_BULLDOZER "-m64 -mavx -mfma")
set(C_FLAGS_TARGET_ARMV8A_ARM_CORTEX_A57 "-march=armv8-a+crc+crypto+simd -mcpu=cortex-a57")
set(C_FLAGS_TARGET_ARMV8A_ARM_CORTEX_A53 "-march=armv8-a+crc+crypto+simd -mcpu=cortex-a53")
set(C_FLAGS_TARGET_ARMV7A_ARM_CORTEX_A15 "-marm -mfloat-abi=hard -mfpu=neon-vfpv4 -mcpu=cortex-a15")
set(C_FLAGS_TARGET_ARMV7A_ARM_CORTEX_A9 "-marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9")
set(C_FLAGS_TARGET_ARMV7A_ARM_CORTEX_A7 "-marm -mfloat-abi=hard -mfpu=neon-vfpv4 -mcpu=cortex-a7")
set(C_FLAGS_TARGET_GENERIC "")
# architecture-specific assembly flags
set(ASM_FLAGS_TARGET_X64_INTEL_HASWELL "")
set(ASM_FLAGS_TARGET_X64_INTEL_SANDY_BRIDGE "")
set(ASM_FLAGS_TARGET_X64_INTEL_CORE "")
set(ASM_FLAGS_TARGET_X64_AMD_BULLDOZER "")
set(ASM_FLAGS_TARGET_ARMV8A_ARM_CORTEX_A57 "")
set(ASM_FLAGS_TARGET_ARMV8A_ARM_CORTEX_A53 "")
set(ASM_FLAGS_TARGET_ARMV7A_ARM_CORTEX_A15 "-mfpu=neon-vfpv4 -mcpu=cortex-a15")
set(ASM_FLAGS_TARGET_ARMV7A_ARM_CORTEX_A9 "-mfpu=neon -mcpu=cortex-a9")
set(ASM_FLAGS_TARGET_ARMV7A_ARM_CORTEX_A7 "-mfpu=neon-vfpv4 -mcpu=cortex-a7")
set(ASM_FLAGS_TARGET_GENERIC "")
if(${TARGET} MATCHES X64_AUTOMATIC)
include(${PROJECT_SOURCE_DIR}/cmake/X64AutomaticTargetSelection.cmake)
X64AutomaticTargetSelection()
message(STATUS "Detected target ${TARGET}")
else()
include(${PROJECT_SOURCE_DIR}/cmake/TestSingleTarget.cmake)
TestSingleTarget()
message(STATUS "Compiling for target: ${TARGET}")
endif()
if(${TARGET} MATCHES X64_INTEL_HASWELL)
set(TARGET_NEED_FEATURE_AVX2 1)
set(TARGET_NEED_FEATURE_FMA 1)
endif()
if(${TARGET} MATCHES X64_INTEL_SANDY_BRIDGE)
set(TARGET_NEED_FEATURE_AVX 1)
endif()
if(${TARGET} MATCHES X64_INTEL_CORE)
set(TARGET_NEED_FEATURE_SSE3 1)
endif()
if(${TARGET} MATCHES X64_AMD_BULLDOZER)
set(TARGET_NEED_FEATURE_AVX 1)
set(TARGET_NEED_FEATURE_FMA 1)
endif()
if(${TARGET} MATCHES ARMV8A_ARM_CORTEX_A57)
set(TARGET_NEED_FEATURE_VFPv4 1)
set(TARGET_NEED_FEATURE_NEONv2 1)
endif()
if(${TARGET} MATCHES ARMV8A_ARM_CORTEX_A53)
set(TARGET_NEED_FEATURE_VFPv4 1)
set(TARGET_NEED_FEATURE_NEONv2 1)
endif()
if(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A15)
set(TARGET_NEED_FEATURE_VFPv3 1)
set(TARGET_NEED_FEATURE_NEON 1)
endif()
if(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A7)
set(TARGET_NEED_FEATURE_VFPv3 1)
set(TARGET_NEED_FEATURE_NEON 1)
endif()
if(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A9)
set(TARGET_NEED_FEATURE_VFPv3 1)
set(TARGET_NEED_FEATURE_NEON 1)
endif()
# Create the target.h file with the proper target definition
configure_file(${PROJECT_SOURCE_DIR}/blasfeo_target.h.in
${CMAKE_CURRENT_SOURCE_DIR}/include/blasfeo_target.h @ONLY)
# Append the appropriate flags based on the architecture and compiler
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTARGET_${TARGET}")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DTARGET_${TARGET}")
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_TARGET_${TARGET}}")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${ASM_FLAGS_TARGET_${TARGET}}")
endif()
# source files
file(GLOB AUX_COMMON_SRC
${PROJECT_SOURCE_DIR}/auxiliary/blasfeo_processor_features.c
${PROJECT_SOURCE_DIR}/auxiliary/blasfeo_stdlib.c
${PROJECT_SOURCE_DIR}/auxiliary/d_aux_common.c
${PROJECT_SOURCE_DIR}/auxiliary/s_aux_common.c
)
file(GLOB AUX_EXT_DEP_SRC
${PROJECT_SOURCE_DIR}/auxiliary/d_aux_ext_dep_common.c
${PROJECT_SOURCE_DIR}/auxiliary/s_aux_ext_dep_common.c
${PROJECT_SOURCE_DIR}/auxiliary/d_aux_ext_dep.c
${PROJECT_SOURCE_DIR}/auxiliary/s_aux_ext_dep.c
${PROJECT_SOURCE_DIR}/auxiliary/v_aux_ext_dep_lib.c
${PROJECT_SOURCE_DIR}/auxiliary/i_aux_ext_dep_lib.c
${PROJECT_SOURCE_DIR}/auxiliary/timing.c
)
file(GLOB AUX_REF_SRC
${PROJECT_SOURCE_DIR}/auxiliary/d_aux_ref.c
${PROJECT_SOURCE_DIR}/auxiliary/s_aux_ref.c
)
file(GLOB BLASFEO_REF_SRC
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas1_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas2_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas2_diag_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas3_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas3_diag_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_lapack_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas1_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas2_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas2_diag_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas3_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas3_diag_ref.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_lapack_ref.c
)
file(GLOB AUX_HP_CM_SRC
${PROJECT_SOURCE_DIR}/auxiliary/d_aux_hp_cm.c
${PROJECT_SOURCE_DIR}/auxiliary/s_aux_hp_cm.c
)
file(GLOB BLASFEO_HP_CM_SRC
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/dgemm.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/dsyrk.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/dtrsm.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/dtrmm.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/dpotrf.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/dgetrf.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/sgemm.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/strsm.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_cm/spotrf.c
)
file(GLOB BLASFEO_HP_CM_REF_SRC
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas1_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas2_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas2_diag_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas3_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas3_diag_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_lapack_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas1_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas2_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas2_diag_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas3_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas3_diag_hp_cm.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_lapack_hp_cm.c
)
file(GLOB BLASFEO_WR_SRC
${PROJECT_SOURCE_DIR}/blasfeo_wr/d_blas1_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/d_blas2_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/d_blas2_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/d_blas3_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/d_blas3_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/d_lapack_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/s_blas1_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/s_blas2_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/s_blas2_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/s_blas3_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/s_blas3_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_wr/s_lapack_lib.c
)
#list(APPEND BLAS_SRC
file(GLOB BLAS_SRC
${PROJECT_SOURCE_DIR}/blas_api/dcopy.c
${PROJECT_SOURCE_DIR}/blas_api/daxpy.c
${PROJECT_SOURCE_DIR}/blas_api/ddot.c
${PROJECT_SOURCE_DIR}/blas_api/dgemm_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/dsyrk_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/dtrmm_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/dtrsm_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/dgesv.c
${PROJECT_SOURCE_DIR}/blas_api/dgetrf_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/dgetrs.c
${PROJECT_SOURCE_DIR}/blas_api/dlaswp.c
${PROJECT_SOURCE_DIR}/blas_api/dposv.c
${PROJECT_SOURCE_DIR}/blas_api/dpotrf_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/dpotrs.c
${PROJECT_SOURCE_DIR}/blas_api/dtrtrs.c
${PROJECT_SOURCE_DIR}/blas_api/saxpy.c
${PROJECT_SOURCE_DIR}/blas_api/sdot.c
${PROJECT_SOURCE_DIR}/blas_api/sgemm_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/strsm_ref.c # XXX
${PROJECT_SOURCE_DIR}/blas_api/spotrf_ref.c # XXX
)
file(GLOB REF_BLAS_SRC
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_blas3_ref_blas.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/d_lapack_ref_blas.c
${PROJECT_SOURCE_DIR}/blasfeo_ref/s_blas3_ref_blas.c
)
file(GLOB BLAS_CM_SRC
${PROJECT_SOURCE_DIR}/blas_api/dgemm_ref.c
${PROJECT_SOURCE_DIR}/blas_api/dsyrk_ref.c
${PROJECT_SOURCE_DIR}/blas_api/dtrmm_ref.c
${PROJECT_SOURCE_DIR}/blas_api/dtrsm_ref.c
${PROJECT_SOURCE_DIR}/blas_api/dpotrf_ref.c
${PROJECT_SOURCE_DIR}/blas_api/dgetrf_ref.c
${PROJECT_SOURCE_DIR}/blas_api/sgemm_ref.c
)
if(${TARGET} MATCHES X64_INTEL_HASWELL OR ${TARGET} MATCHES X64_INTEL_SANDY_BRIDGE)
file(GLOB BLASFEO_HP_PM_SRC
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas1_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas2_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas2_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas3_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas3_diag_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_lapack_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas1_lib8.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas2_lib8.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas2_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas3_lib8.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas3_diag_lib8.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_lapack_lib8.c
)
file(GLOB AUX_HP_PM_SRC
${PROJECT_SOURCE_DIR}/auxiliary/d_aux_lib4.c
${PROJECT_SOURCE_DIR}/auxiliary/s_aux_lib8.c
${PROJECT_SOURCE_DIR}/auxiliary/m_aux_lib48.c
)
endif()
if(${TARGET} MATCHES X64_INTEL_CORE OR ${TARGET} MATCHES X64_AMD_BULLDOZER OR ${TARGET} MATCHES ARMV8A_ARM_CORTEX_A57 OR ${TARGET} MATCHES ARMV8A_ARM_CORTEX_A53 OR ${TARGET} MATCHES ARMV7A_ARM_CORTEX_A15 OR ${TARGET} MATCHES ARMV7A_ARM_CORTEX_A7 OR ${TARGET} MATCHES ARMV7A_ARM_CORTEX_A9 OR ${TARGET} MATCHES GENERIC)
file(GLOB BLASFEO_HP_PM_SRC
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas1_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas2_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas2_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas3_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_blas3_diag_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/d_lapack_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas1_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas2_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas2_diag_lib.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas3_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_blas3_diag_lib4.c
${PROJECT_SOURCE_DIR}/blasfeo_hp_pm/s_lapack_lib4.c
)
file(GLOB AUX_HP_PM_SRC
${PROJECT_SOURCE_DIR}/auxiliary/d_aux_lib4.c
${PROJECT_SOURCE_DIR}/auxiliary/s_aux_lib4.c
${PROJECT_SOURCE_DIR}/auxiliary/m_aux_lib44.c
)
endif()
if(${TARGET} MATCHES X64_INTEL_HASWELL)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgemm_12x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgemm_8x8_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgemv_8_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dsymv_6_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgebp_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgelqf_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemv_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dpack_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_sgemm_24x4_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_sgemm_16x4_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_sgemm_8x8_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx2/kernel_sgemm_8x4_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemm_diag_lib8.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemv_8_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemv_4_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgecpsc_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgead_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgetr_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_spack_lib8.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_8x4_lib8.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/sse3/kernel_align_x64.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_d_aux_lib.S
)
endif(${TARGET} MATCHES X64_INTEL_HASWELL)
if(${TARGET} MATCHES X64_INTEL_SANDY_BRIDGE)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemm_12x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemv_12_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemv_8_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgemv_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dsymv_6_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgebp_lib4.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_dpack_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemm_16x4_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemm_8x8_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemm_8x4_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemm_diag_lib8.c
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemv_8_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgemv_4_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgecpsc_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgetr_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_sgead_lib8.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_spack_lib8.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_8x4_lib8.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/sse3/kernel_align_x64.S
${PROJECT_SOURCE_DIR}/kernel/avx/kernel_d_aux_lib.S
)
endif(${TARGET} MATCHES X64_INTEL_SANDY_BRIDGE)
if(${TARGET} MATCHES X64_INTEL_CORE)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/sse3/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/sse3/kernel_dgemv_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/sse3/kernel_sgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/sse3/kernel_align_x64.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_d_aux_lib.c
)
endif(${TARGET} MATCHES X64_INTEL_CORE)
if(${TARGET} MATCHES X64_AMD_BULLDOZER)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/fma/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/sse3/kernel_align_x64.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_d_aux_lib.c
)
endif(${TARGET} MATCHES X64_AMD_BULLDOZER)
if(${TARGET} MATCHES ARMV8A_ARM_CORTEX_A57)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dpack_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgetrf_pivot_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgemv_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_16x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_12x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_8x8_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemv_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_spack_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_align_generic.c
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_d_aux_lib.S
)
endif(${TARGET} MATCHES ARMV8A_ARM_CORTEX_A57)
if(${TARGET} MATCHES ARMV8A_ARM_CORTEX_A53)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgemm_12x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dpack_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgetrf_pivot_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_dgemv_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_16x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_12x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_8x8_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_sgemv_4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_spack_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_align_generic.c
${PROJECT_SOURCE_DIR}/kernel/armv8a/kernel_d_aux_lib.S
)
endif(${TARGET} MATCHES ARMV8A_ARM_CORTEX_A53)
if(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A15)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_sgemm_12x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_sgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_sgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_align_generic.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_d_aux_lib.c
)
endif(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A15)
if(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A7)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_sgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_sgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_align_generic.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_d_aux_lib.c
)
endif(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A7)
if(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A9)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_dgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_sgemm_8x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/armv7a/kernel_sgemm_4x4_lib4.S
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_saxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_align_generic.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_d_aux_lib.c
)
endif(${TARGET} MATCHES ARMV7A_ARM_CORTEX_A9)
if(${TARGET} MATCHES GENERIC)
file(GLOB KERNEL_SRC
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dsymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dgeqrf_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_dpack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ddot_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_daxpy_lib.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_4x4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemm_diag_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgemv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_ssymv_4_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetrf_pivot_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgecp_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sgetr_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_spack_lib4.c
${PROJECT_SOURCE_DIR}/kernel/generic/kernel_sdot_lib.c