You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

prebuild.cmake 54 kB

2 months ago
2 months ago
5 years ago
5 years ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679
  1. ###############################################################################
  2. # Copyright (c) 2025, The OpenBLAS Project
  3. # All rights reserved.
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions are
  6. # met:
  7. # 1. Redistributions of source code must retain the above copyright
  8. # notice, this list of conditions and the following disclaimer.
  9. # 2. Redistributions in binary form must reproduce the above copyright
  10. # notice, this list of conditions and the following disclaimer in
  11. # the documentation and/or other materials provided with the
  12. # distribution.
  13. # 3. Neither the name of the OpenBLAS project nor the names of
  14. # its contributors may be used to endorse or promote products
  15. # derived from this software without specific prior written permission.
  16. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. # ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
  20. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  23. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  24. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  25. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  26. # POSSIBILITY OF SUCH DAMAGE.
  27. ###############################################################################
  28. ##
  29. ## Author: Hank Anderson <hank@statease.com>
  30. ## Description: Ported from OpenBLAS/Makefile.prebuild
  31. ## This is triggered by system.cmake and runs before any of the code is built.
  32. ## Creates config.h and Makefile.conf by first running the c_check perl script (which creates those files).
  33. ## Next it runs f_check and appends some fortran information to the files.
  34. ## Then it runs getarch and getarch_2nd for even more environment information.
  35. ## Finally it builds gen_config_h for use at build time to generate config.h.
  36. # CMake vars set by this file:
  37. # CORE
  38. # LIBCORE
  39. # NUM_CORES
  40. # HAVE_MMX
  41. # HAVE_SSE
  42. # HAVE_SSE2
  43. # HAVE_SSE3
  44. # MAKE
  45. # SBGEMM_UNROLL_M
  46. # SBGEMM_UNROLL_N
  47. # SGEMM_UNROLL_M
  48. # SGEMM_UNROLL_N
  49. # DGEMM_UNROLL_M
  50. # DGEMM_UNROLL_M
  51. # QGEMM_UNROLL_N
  52. # QGEMM_UNROLL_N
  53. # CGEMM_UNROLL_M
  54. # CGEMM_UNROLL_M
  55. # ZGEMM_UNROLL_N
  56. # ZGEMM_UNROLL_N
  57. # XGEMM_UNROLL_M
  58. # XGEMM_UNROLL_N
  59. # CGEMM3M_UNROLL_M
  60. # CGEMM3M_UNROLL_N
  61. # ZGEMM3M_UNROLL_M
  62. # ZGEMM3M_UNROLL_M
  63. # XGEMM3M_UNROLL_N
  64. # XGEMM3M_UNROLL_N
  65. # CPUIDEMU = ../../cpuid/table.o
  66. if (DEFINED CPUIDEMU)
  67. set(EXFLAGS "-DCPUIDEMU -DVENDOR=99")
  68. endif ()
  69. if (BUILD_KERNEL)
  70. # set the C flags for just this file
  71. set(GETARCH2_FLAGS "-DBUILD_KERNEL")
  72. set(TARGET_CONF "config_kernel.h")
  73. set(TARGET_CONF_DIR ${PROJECT_BINARY_DIR}/kernel_config/${TARGET_CORE})
  74. else()
  75. set(TARGET_CONF "config.h")
  76. set(TARGET_CONF_DIR ${PROJECT_BINARY_DIR})
  77. endif ()
  78. set(TARGET_CONF_TEMP "${PROJECT_BINARY_DIR}/${TARGET_CONF}.tmp")
  79. # c_check
  80. set(FU "")
  81. if (APPLE OR (MSVC AND NOT (${CMAKE_C_COMPILER_ID} MATCHES "Clang" OR ${CMAKE_C_COMPILER_ID} MATCHES "IntelLLVM")))
  82. set(FU "_")
  83. endif()
  84. if(MINGW AND NOT MINGW64)
  85. set(FU "_")
  86. endif()
  87. set(COMPILER_ID ${CMAKE_C_COMPILER_ID})
  88. if (${COMPILER_ID} STREQUAL "GNU")
  89. set(COMPILER_ID "GCC")
  90. endif ()
  91. string(TOUPPER ${ARCH} UC_ARCH)
  92. file(WRITE ${TARGET_CONF_TEMP}
  93. "#define OS_${HOST_OS}\t1\n"
  94. "#define ARCH_${UC_ARCH}\t1\n"
  95. "#define C_${COMPILER_ID}\t1\n"
  96. "#define __${BINARY}BIT__\t1\n"
  97. "#define FUNDERSCORE\t${FU}\n")
  98. if (${HOST_OS} STREQUAL "WINDOWSSTORE")
  99. file(APPEND ${TARGET_CONF_TEMP}
  100. "#define OS_WINNT\t1\n")
  101. endif ()
  102. # f_check
  103. if (NOT NOFORTRAN)
  104. include("${PROJECT_SOURCE_DIR}/cmake/f_check.cmake")
  105. else ()
  106. file(APPEND ${TARGET_CONF_TEMP}
  107. "#define BUNDERSCORE _\n"
  108. "#define NEEDBUNDERSCORE 1\n")
  109. set(BU "_")
  110. endif ()
  111. # Cannot run getarch on target if we are cross-compiling
  112. if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSSTORE"))
  113. # Write to config as getarch would
  114. if (DEFINED TARGET_CORE)
  115. set(TCORE ${TARGET_CORE})
  116. else()
  117. set(TCORE ${CORE})
  118. endif()
  119. # TODO: Set up defines that getarch sets up based on every other target
  120. # Perhaps this should be inside a different file as it grows larger
  121. file(APPEND ${TARGET_CONF_TEMP}
  122. "#define ${TCORE}\n"
  123. "#define CORE_${TCORE}\n"
  124. "#define CHAR_CORENAME \"${TCORE}\"\n")
  125. if ("${TCORE}" STREQUAL "CORE2")
  126. file(APPEND ${TARGET_CONF_TEMP}
  127. "#define L1_DATA_SIZE\t32768\n"
  128. "#define L1_DATA_LINESIZE\t64\n"
  129. "#define L2_SIZE\t1048576\n"
  130. "#define L2_LINESIZE\t64\n"
  131. "#define DTB_DEFAULT_ENTRIES\t256\n"
  132. "#define DTB_SIZE\t4096\n"
  133. "#define HAVE_CMOV\n"
  134. "#define HAVE_MMX\n"
  135. "#define HAVE_SSE\n"
  136. "#define HAVE_SSE2\n"
  137. "#define HAVE_SSE3\n"
  138. "#define HAVE_SSSE3\n"
  139. "#define SLOCAL_BUFFER_SIZE\t16384\n"
  140. "#define DLOCAL_BUFFER_SIZE\t16384\n"
  141. "#define CLOCAL_BUFFER_SIZE\t16384\n"
  142. "#define ZLOCAL_BUFFER_SIZE\t16384\n")
  143. set(HAVE_SSE 1)
  144. set(HAVE_SSE2 1)
  145. set(HAVE_SSE3 1)
  146. set(HAVE_SSSE3 1)
  147. set(BGEMM_UNROLL_M 8)
  148. set(BGEMM_UNROLL_N 4)
  149. set(SBGEMM_UNROLL_M 8)
  150. set(SBGEMM_UNROLL_N 4)
  151. set(SGEMM_UNROLL_M 8)
  152. set(SGEMM_UNROLL_N 4)
  153. set(DGEMM_UNROLL_M 4)
  154. set(DGEMM_UNROLL_N 4)
  155. set(CGEMM_UNROLL_M 4)
  156. set(CGEMM_UNROLL_N 2)
  157. set(ZGEMM_UNROLL_M 2)
  158. set(ZGEMM_UNROLL_N 2)
  159. set(CGEMM3M_UNROLL_M 8)
  160. set(CGEMM3M_UNROLL_N 4)
  161. set(ZGEMM3M_UNROLL_M 4)
  162. set(ZGEMM3M_UNROLL_N 4)
  163. elseif ("${TCORE}" STREQUAL "ATOM")
  164. file(APPEND ${TARGET_CONF_TEMP}
  165. "#define L1_DATA_SIZE\t24576\n"
  166. "#define L1_DATA_LINESIZE\t64\n"
  167. "#define L2_SIZE\t524288\n"
  168. "#define L2_LINESIZE\t64\n"
  169. "#define DTB_DEFAULT_ENTRIES\t64\n"
  170. "#define DTB_SIZE\t4096\n"
  171. "#define HAVE_CMOV\n"
  172. "#define HAVE_MMX\n"
  173. "#define HAVE_SSE\n"
  174. "#define HAVE_SSE2\n"
  175. "#define HAVE_SSE3\n"
  176. "#define HAVE_SSSE3\n"
  177. "#define SLOCAL_BUFFER_SIZE\t16384\n"
  178. "#define DLOCAL_BUFFER_SIZE\t8192\n"
  179. "#define CLOCAL_BUFFER_SIZE\t16384\n"
  180. "#define ZLOCAL_BUFFER_SIZE\t8192\n")
  181. set(HAVE_SSE 1)
  182. set(HAVE_SSE2 1)
  183. set(HAVE_SSE3 1)
  184. set(HAVE_SSSE3 1)
  185. set(SBGEMM_UNROLL_M 8)
  186. set(SBGEMM_UNROLL_N 4)
  187. set(SGEMM_UNROLL_M 8)
  188. set(SGEMM_UNROLL_N 4)
  189. set(DGEMM_UNROLL_M 4)
  190. set(DGEMM_UNROLL_N 2)
  191. set(CGEMM_UNROLL_M 4)
  192. set(CGEMM_UNROLL_N 2)
  193. set(ZGEMM_UNROLL_M 2)
  194. set(ZGEMM_UNROLL_N 1)
  195. set(CGEMM3M_UNROLL_M 8)
  196. set(CGEMM3M_UNROLL_N 4)
  197. set(ZGEMM3M_UNROLL_M 4)
  198. set(ZGEMM3M_UNROLL_N 4)
  199. elseif ("${TCORE}" STREQUAL "PRESCOTT")
  200. file(APPEND ${TARGET_CONF_TEMP}
  201. "#define L1_DATA_SIZE\t16384\n"
  202. "#define L1_DATA_LINESIZE\t64\n"
  203. "#define L2_SIZE\t1048576\n"
  204. "#define L2_LINESIZE\t64\n"
  205. "#define DTB_DEFAULT_ENTRIES\t64\n"
  206. "#define DTB_SIZE\t4096\n"
  207. "#define HAVE_CMOV\n"
  208. "#define HAVE_MMX\n"
  209. "#define HAVE_SSE\n"
  210. "#define HAVE_SSE2\n"
  211. "#define HAVE_SSE3\n"
  212. "#define SLOCAL_BUFFER_SIZE\t8192\n"
  213. "#define DLOCAL_BUFFER_SIZE\t8192\n"
  214. "#define CLOCAL_BUFFER_SIZE\t8192\n"
  215. "#define ZLOCAL_BUFFER_SIZE\t8192\n")
  216. set(HAVE_SSE 1)
  217. set(HAVE_SSE2 1)
  218. set(HAVE_SSE3 1)
  219. set(SBGEMM_UNROLL_M 8)
  220. set(SBGEMM_UNROLL_N 4)
  221. set(SGEMM_UNROLL_M 8)
  222. set(SGEMM_UNROLL_N 4)
  223. set(DGEMM_UNROLL_M 4)
  224. set(DGEMM_UNROLL_N 4)
  225. set(CGEMM_UNROLL_M 4)
  226. set(CGEMM_UNROLL_N 2)
  227. set(ZGEMM_UNROLL_M 2)
  228. set(ZGEMM_UNROLL_N 2)
  229. set(CGEMM3M_UNROLL_M 8)
  230. set(CGEMM3M_UNROLL_N 4)
  231. set(ZGEMM3M_UNROLL_M 4)
  232. set(ZGEMM3M_UNROLL_N 4)
  233. elseif ("${TCORE}" STREQUAL "NEHALEM")
  234. file(APPEND ${TARGET_CONF_TEMP}
  235. "#define L1_DATA_SIZE\t32768\n"
  236. "#define L1_DATA_LINESIZE\t64\n"
  237. "#define L2_SIZE\t262144\n"
  238. "#define L2_LINESIZE\t64\n"
  239. "#define DTB_DEFAULT_ENTRIES\t64\n"
  240. "#define DTB_SIZE\t4096\n"
  241. "#define HAVE_CMOV\n"
  242. "#define HAVE_MMX\n"
  243. "#define HAVE_SSE\n"
  244. "#define HAVE_SSE2\n"
  245. "#define HAVE_SSE3\n"
  246. "#define HAVE_SSSE3\n"
  247. "#define HAVE_SSE4_1\n"
  248. "#define HAVE_SSE4_2\n"
  249. "#define SLOCAL_BUFFER_SIZE\t65535\n"
  250. "#define DLOCAL_BUFFER_SIZE\t32768\n"
  251. "#define CLOCAL_BUFFER_SIZE\t65536\n"
  252. "#define ZLOCAL_BUFFER_SIZE\t32768\n")
  253. set(HAVE_SSE 1)
  254. set(HAVE_SSE2 1)
  255. set(HAVE_SSE3 1)
  256. set(HAVE_SSSE3 1)
  257. set(HAVE_SSE4_1 1)
  258. set(HAVE_SSE4_2 1)
  259. set(SBGEMM_UNROLL_M 8)
  260. set(SBGEMM_UNROLL_N 4)
  261. set(SGEMM_UNROLL_M 4)
  262. set(SGEMM_UNROLL_N 8)
  263. set(DGEMM_UNROLL_M 2)
  264. set(DGEMM_UNROLL_N 8)
  265. set(CGEMM_UNROLL_M 2)
  266. set(CGEMM_UNROLL_N 4)
  267. set(ZGEMM_UNROLL_M 1)
  268. set(ZGEMM_UNROLL_N 4)
  269. set(CGEMM3M_UNROLL_M 4)
  270. set(CGEMM3M_UNROLL_N 8)
  271. set(ZGEMM3M_UNROLL_M 2)
  272. set(ZGEMM3M_UNROLL_N 8)
  273. elseif ("${TCORE}" STREQUAL "SANDYBRIDGE")
  274. file(APPEND ${TARGET_CONF_TEMP}
  275. "#define L1_DATA_SIZE\t32768\n"
  276. "#define L1_DATA_LINESIZE\t64\n"
  277. "#define L2_SIZE\t262144\n"
  278. "#define L2_LINESIZE\t64\n"
  279. "#define DTB_DEFAULT_ENTRIES\t64\n"
  280. "#define DTB_SIZE\t4096\n"
  281. "#define HAVE_CMOV\n"
  282. "#define HAVE_MMX\n"
  283. "#define HAVE_SSE\n"
  284. "#define HAVE_SSE2\n"
  285. "#define HAVE_SSE3\n"
  286. "#define HAVE_SSSE3\n"
  287. "#define HAVE_SSE4_1\n"
  288. "#define HAVE_SSE4_2\n"
  289. "#define HAVE_AVX\n"
  290. "#define SLOCAL_BUFFER_SIZE\t24576\n"
  291. "#define DLOCAL_BUFFER_SIZE\t16384\n"
  292. "#define CLOCAL_BUFFER_SIZE\t32768\n"
  293. "#define ZLOCAL_BUFFER_SIZE\t24576\n")
  294. set(HAVE_SSE 1)
  295. set(HAVE_SSE2 1)
  296. set(HAVE_SSE3 1)
  297. set(HAVE_SSSE3 1)
  298. set(HAVE_SSE4_1 1)
  299. set(HAVE_SSE4_2 1)
  300. set(HAVE_AVX 1)
  301. set(SBGEMM_UNROLL_M 8)
  302. set(SBGEMM_UNROLL_N 4)
  303. set(SGEMM_UNROLL_M 16)
  304. set(SGEMM_UNROLL_N 4)
  305. set(DGEMM_UNROLL_M 8)
  306. set(DGEMM_UNROLL_N 4)
  307. set(CGEMM_UNROLL_M 8)
  308. set(CGEMM_UNROLL_N 2)
  309. set(ZGEMM_UNROLL_M 1)
  310. set(ZGEMM_UNROLL_N 4)
  311. set(CGEMM3M_UNROLL_M 4)
  312. set(CGEMM3M_UNROLL_N 8)
  313. set(ZGEMM3M_UNROLL_M 2)
  314. set(ZGEMM3M_UNROLL_N 8)
  315. elseif ("${TCORE}" STREQUAL "HASWELL")
  316. file(APPEND ${TARGET_CONF_TEMP}
  317. "#define L1_DATA_SIZE\t32768\n"
  318. "#define L1_DATA_LINESIZE\t64\n"
  319. "#define L2_SIZE\t262144\n"
  320. "#define L2_LINESIZE\t64\n"
  321. "#define DTB_DEFAULT_ENTRIES\t64\n"
  322. "#define DTB_SIZE\t4096\n"
  323. "#define HAVE_CMOV\n"
  324. "#define HAVE_MMX\n"
  325. "#define HAVE_SSE\n"
  326. "#define HAVE_SSE2\n"
  327. "#define HAVE_SSE3\n"
  328. "#define HAVE_SSSE3\n"
  329. "#define HAVE_SSE4_1\n"
  330. "#define HAVE_SSE4_2\n"
  331. "#define HAVE_AVX\n"
  332. "#define HAVE_AVX2\n"
  333. "#define HAVE_FMA3\n"
  334. "#define SLOCAL_BUFFER_SIZE\t20480\n"
  335. "#define DLOCAL_BUFFER_SIZE\t32768\n"
  336. "#define CLOCAL_BUFFER_SIZE\t16384\n"
  337. "#define ZLOCAL_BUFFER_SIZE\t12288\n")
  338. set(HAVE_SSE 1)
  339. set(HAVE_SSE2 1)
  340. set(HAVE_SSE3 1)
  341. set(HAVE_SSSE3 1)
  342. set(HAVE_SSE4_1 1)
  343. set(HAVE_SSE4_2 1)
  344. set(HAVE_AVX 1)
  345. set(HAVE_AVX2 1)
  346. set(HAVE_FMA3 1)
  347. set(SBGEMM_UNROLL_M 8)
  348. set(SBGEMM_UNROLL_N 4)
  349. set(SGEMM_UNROLL_M 8)
  350. set(SGEMM_UNROLL_N 4)
  351. set(DGEMM_UNROLL_M 4)
  352. set(DGEMM_UNROLL_N 8)
  353. set(CGEMM_UNROLL_M 8)
  354. set(CGEMM_UNROLL_N 2)
  355. set(ZGEMM_UNROLL_M 4)
  356. set(ZGEMM_UNROLL_N 2)
  357. set(CGEMM3M_UNROLL_M 8)
  358. set(CGEMM3M_UNROLL_N 4)
  359. set(ZGEMM3M_UNROLL_M 4)
  360. set(ZGEMM3M_UNROLL_N 4)
  361. elseif ("${TCORE}" STREQUAL "SKYLAKEX")
  362. file(APPEND ${TARGET_CONF_TEMP}
  363. "#define L1_DATA_SIZE\t32768\n"
  364. "#define L1_DATA_LINESIZE\t64\n"
  365. "#define L2_SIZE\t262144\n"
  366. "#define L2_LINESIZE\t64\n"
  367. "#define DTB_DEFAULT_ENTRIES\t64\n"
  368. "#define DTB_SIZE\t4096\n"
  369. "#define HAVE_CMOV\n"
  370. "#define HAVE_MMX\n"
  371. "#define HAVE_SSE\n"
  372. "#define HAVE_SSE2\n"
  373. "#define HAVE_SSE3\n"
  374. "#define HAVE_SSSE3\n"
  375. "#define HAVE_SSE4_1\n"
  376. "#define HAVE_SSE4_2\n"
  377. "#define HAVE_AVX\n"
  378. "#define HAVE_AVX2\n"
  379. "#define HAVE_FMA3\n"
  380. "#define HAVE_AVX512VL\n"
  381. "#define SLOCAL_BUFFER_SIZE\t28672\n"
  382. "#define DLOCAL_BUFFER_SIZE\t12288\n"
  383. "#define CLOCAL_BUFFER_SIZE\t12288\n"
  384. "#define ZLOCAL_BUFFER_SIZE\t8192\n")
  385. set(HAVE_CMOV 1)
  386. set(HAVE_MMX 1)
  387. set(HAVE_SSE 1)
  388. set(HAVE_SSE2 1)
  389. set(HAVE_SSE3 1)
  390. set(HAVE_SSSE3 1)
  391. set(HAVE_SSE4_1 1)
  392. set(HAVE_SSE4_2 1)
  393. set(HAVE_AVX 1)
  394. set(HAVE_AVX2 1)
  395. set(HAVE_FMA3 1)
  396. set(HAVE_AVX512VL 1)
  397. set(SBGEMM_UNROLL_M 8)
  398. set(SBGEMM_UNROLL_N 4)
  399. set(SGEMM_UNROLL_M 16)
  400. set(SGEMM_UNROLL_N 4)
  401. set(DGEMM_UNROLL_M 16)
  402. set(DGEMM_UNROLL_N 2)
  403. set(CGEMM_UNROLL_M 8)
  404. set(CGEMM_UNROLL_N 2)
  405. set(ZGEMM_UNROLL_M 4)
  406. set(ZGEMM_UNROLL_N 2)
  407. set(CGEMM3M_UNROLL_M 8)
  408. set(CGEMM3M_UNROLL_N 4)
  409. set(ZGEMM3M_UNROLL_M 4)
  410. set(ZGEMM3M_UNROLL_N 4)
  411. elseif ("${TCORE}" STREQUAL "COOPERLAKE")
  412. file(APPEND ${TARGET_CONF_TEMP}
  413. "#define L1_DATA_SIZE\t32768\n"
  414. "#define L1_DATA_LINESIZE\t64\n"
  415. "#define L2_SIZE\t262144\n"
  416. "#define L2_LINESIZE\t64\n"
  417. "#define DTB_DEFAULT_ENTRIES\t64\n"
  418. "#define DTB_SIZE\t4096\n"
  419. "#define HAVE_CMOV\n"
  420. "#define HAVE_MMX\n"
  421. "#define HAVE_SSE\n"
  422. "#define HAVE_SSE2\n"
  423. "#define HAVE_SSE3\n"
  424. "#define HAVE_SSSE3\n"
  425. "#define HAVE_SSE4_1\n"
  426. "#define HAVE_SSE4_2\n"
  427. "#define HAVE_AVX\n"
  428. "#define HAVE_AVX2\n"
  429. "#define HAVE_FMA3\n"
  430. "#define HAVE_AVX512VL\n"
  431. "#define HAVE_AVX512BF16\n"
  432. "#define SLOCAL_BUFFER_SIZE\t20480\n"
  433. "#define DLOCAL_BUFFER_SIZE\t12288\n"
  434. "#define CLOCAL_BUFFER_SIZE\t12288\n"
  435. "#define ZLOCAL_BUFFER_SIZE\t8192\n")
  436. set(HAVE_CMOV 1)
  437. set(HAVE_MMX 1)
  438. set(HAVE_SSE 1)
  439. set(HAVE_SSE2 1)
  440. set(HAVE_SSE3 1)
  441. set(HAVE_SSSE3 1)
  442. set(HAVE_SSE4_1 1)
  443. set(HAVE_SSE4_2 1)
  444. set(HAVE_AVX 1)
  445. set(HAVE_AVX2 1)
  446. set(HAVE_FMA3 1)
  447. set(HAVE_AVX512VL 1)
  448. set(HAVE_AVX512BF16 1)
  449. set(SBGEMM_UNROLL_M 16)
  450. set(SBGEMM_UNROLL_N 4)
  451. set(SGEMM_UNROLL_M 16)
  452. set(SGEMM_UNROLL_N 4)
  453. set(DGEMM_UNROLL_M 16)
  454. set(DGEMM_UNROLL_N 2)
  455. set(CGEMM_UNROLL_M 8)
  456. set(CGEMM_UNROLL_N 2)
  457. set(ZGEMM_UNROLL_M 4)
  458. set(ZGEMM_UNROLL_N 2)
  459. set(CGEMM3M_UNROLL_M 8)
  460. set(CGEMM3M_UNROLL_N 4)
  461. set(ZGEMM3M_UNROLL_M 4)
  462. set(ZGEMM3M_UNROLL_N 4)
  463. elseif ("${TCORE}" STREQUAL "SAPPHIRERAPIDS")
  464. file(APPEND ${TARGET_CONF_TEMP}
  465. "#define L1_DATA_SIZE\t32768\n"
  466. "#define L1_DATA_LINESIZE\t64\n"
  467. "#define L2_SIZE\t262144\n"
  468. "#define L2_LINESIZE\t64\n"
  469. "#define DTB_DEFAULT_ENTRIES\t64\n"
  470. "#define DTB_SIZE\t4096\n"
  471. "#define HAVE_CMOV\n"
  472. "#define HAVE_MMX\n"
  473. "#define HAVE_SSE\n"
  474. "#define HAVE_SSE2\n"
  475. "#define HAVE_SSE3\n"
  476. "#define HAVE_SSSE3\n"
  477. "#define HAVE_SSE4_1\n"
  478. "#define HAVE_SSE4_2\n"
  479. "#define HAVE_AVX\n"
  480. "#define HAVE_AVX2\n"
  481. "#define HAVE_FMA3\n"
  482. "#define HAVE_AVX512VL\n"
  483. "#define HAVE_AVX512BF16\n"
  484. "#define SLOCAL_BUFFER_SIZE\t20480\n"
  485. "#define DLOCAL_BUFFER_SIZE\t12288\n"
  486. "#define CLOCAL_BUFFER_SIZE\t12288\n"
  487. "#define ZLOCAL_BUFFER_SIZE\t8192\n")
  488. set(HAVE_CMOV 1)
  489. set(HAVE_MMX 1)
  490. set(HAVE_SSE 1)
  491. set(HAVE_SSE2 1)
  492. set(HAVE_SSE3 1)
  493. set(HAVE_SSSE3 1)
  494. set(HAVE_SSE4_1 1)
  495. set(HAVE_SSE4_2 1)
  496. set(HAVE_AVX 1)
  497. set(HAVE_AVX2 1)
  498. set(HAVE_FMA3 1)
  499. set(HAVE_AVX512VL 1)
  500. set(HAVE_AVX512BF16 1)
  501. set(SBGEMM_UNROLL_M 32)
  502. set(SBGEMM_UNROLL_N 16)
  503. set(SGEMM_UNROLL_M 16)
  504. set(SGEMM_UNROLL_N 4)
  505. set(DGEMM_UNROLL_M 16)
  506. set(DGEMM_UNROLL_N 2)
  507. set(CGEMM_UNROLL_M 8)
  508. set(CGEMM_UNROLL_N 2)
  509. set(ZGEMM_UNROLL_M 4)
  510. set(ZGEMM_UNROLL_N 2)
  511. set(CGEMM3M_UNROLL_M 8)
  512. set(CGEMM3M_UNROLL_N 4)
  513. set(ZGEMM3M_UNROLL_M 4)
  514. set(ZGEMM3M_UNROLL_N 4)
  515. elseif ("${TCORE}" STREQUAL "OPTERON")
  516. file(APPEND ${TARGET_CONF_TEMP}
  517. "#define L1_DATA_SIZE\t65536\n"
  518. "#define L1_DATA_LINESIZE\t64\n"
  519. "#define L2_SIZE\t1048576\n"
  520. "#define L2_LINESIZE\t64\n"
  521. "#define DTB_DEFAULT_ENTRIES\t32\n"
  522. "#define DTB_SIZE\t4096\n"
  523. "#define HAVE_3DNOW\n"
  524. "#define HAVE_3DNOWEX\n"
  525. "#define HAVE_MMX\n"
  526. "#define HAVE_SSE\n"
  527. "#define HAVE_SSE2\n"
  528. "#define SLOCAL_BUFFER_SIZE\t15360\n"
  529. "#define DLOCAL_BUFFER_SIZE\t15360\n"
  530. "#define CLOCAL_BUFFER_SIZE\t15360\n"
  531. "#define ZLOCAL_BUFFER_SIZE\t15360\n")
  532. set(HAVE_3DNOW 1)
  533. set(HAVE_3DNOWEX 1)
  534. set(HAVE_MMX 1)
  535. set(HAVE_SSE 1)
  536. set(HAVE_SSE2 1)
  537. set(SBGEMM_UNROLL_M 8)
  538. set(SBGEMM_UNROLL_N 4)
  539. set(SGEMM_UNROLL_M 8)
  540. set(SGEMM_UNROLL_N 4)
  541. set(DGEMM_UNROLL_M 4)
  542. set(DGEMM_UNROLL_N 4)
  543. set(CGEMM_UNROLL_M 4)
  544. set(CGEMM_UNROLL_N 2)
  545. set(ZGEMM_UNROLL_M 2)
  546. set(ZGEMM_UNROLL_N 2)
  547. set(CGEMM3M_UNROLL_M 8)
  548. set(CGEMM3M_UNROLL_N 4)
  549. set(ZGEMM3M_UNROLL_M 4)
  550. set(ZGEMM3M_UNROLL_N 4)
  551. elseif ("${TCORE}" STREQUAL "BARCELONA")
  552. file(APPEND ${TARGET_CONF_TEMP}
  553. "#define L1_DATA_SIZE\t32768\n"
  554. "#define L1_DATA_LINESIZE\t64\n"
  555. "#define L2_SIZE\t524288\n"
  556. "#define L2_LINESIZE\t64\n"
  557. "#define DTB_DEFAULT_ENTRIES\t64\n"
  558. "#define DTB_SIZE\t4096\n"
  559. "#define HAVE_MMX\n"
  560. "#define HAVE_SSE\n"
  561. "#define HAVE_SSE2\n"
  562. "#define HAVE_SSE3\n"
  563. "#define HAVE_SSE4A\n"
  564. "#define HAVE_MISALIGNSSE\n"
  565. "#define HAVE_128BITFPU\n"
  566. "#define HAVE_FASTMOVU\n"
  567. "#define SLOCAL_BUFFER_SIZE\t14336\n"
  568. "#define DLOCAL_BUFFER_SIZE\t14336\n"
  569. "#define CLOCAL_BUFFER_SIZE\t14336\n"
  570. "#define ZLOCAL_BUFFER_SIZE\t14336\n")
  571. set(HAVE_SSE 1)
  572. set(HAVE_SSE2 1)
  573. set(HAVE_SSE3 1)
  574. set(HAVE_SSE4A 1)
  575. set(HAVE_MISALIGNSSE 1)
  576. set(HAVE_128BITFPU 1)
  577. set(HAVE_FASTMOVU 1)
  578. set(SBGEMM_UNROLL_M 8)
  579. set(SBGEMM_UNROLL_N 4)
  580. set(SGEMM_UNROLL_M 8)
  581. set(SGEMM_UNROLL_N 4)
  582. set(DGEMM_UNROLL_M 4)
  583. set(DGEMM_UNROLL_N 4)
  584. set(CGEMM_UNROLL_M 4)
  585. set(CGEMM_UNROLL_N 2)
  586. set(ZGEMM_UNROLL_M 2)
  587. set(ZGEMM_UNROLL_N 2)
  588. set(CGEMM3M_UNROLL_M 8)
  589. set(CGEMM3M_UNROLL_N 4)
  590. set(ZGEMM3M_UNROLL_M 4)
  591. set(ZGEMM3M_UNROLL_N 4)
  592. elseif ("${TCORE}" STREQUAL "BULLDOZER")
  593. file(APPEND ${TARGET_CONF_TEMP}
  594. "#define L1_DATA_SIZE\t49152\n"
  595. "#define L1_DATA_LINESIZE\t64\n"
  596. "#define L2_SIZE\t1024000\n"
  597. "#define L2_LINESIZE\t64\n"
  598. "#define DTB_DEFAULT_ENTRIES\t32\n"
  599. "#define DTB_SIZE\t4096\n"
  600. "#define HAVE_MMX\n"
  601. "#define HAVE_SSE\n"
  602. "#define HAVE_SSE2\n"
  603. "#define HAVE_SSE3\n"
  604. "#define HAVE_SSE4A\n"
  605. "#define HAVE_AVX\n"
  606. "#define HAVE_MISALIGNSSE\n"
  607. "#define HAVE_128BITFPU\n"
  608. "#define HAVE_FASTMOVU\n"
  609. "#define SLOCAL_BUFFER_SIZE\t5376\n"
  610. "#define DLOCAL_BUFFER_SIZE\t5376\n"
  611. "#define CLOCAL_BUFFER_SIZE\t14336\n"
  612. "#define ZLOCAL_BUFFER_SIZE\t14336\n")
  613. set(HAVE_SSE 1)
  614. set(HAVE_SSE2 1)
  615. set(HAVE_SSE3 1)
  616. set(HAVE_SSE4A 1)
  617. set(HAVE_AVX 1)
  618. set(HAVE_MISALIGNSSE 1)
  619. set(HAVE_128BITFPU 1)
  620. set(HAVE_FASTMOVU 1)
  621. set(SBGEMM_UNROLL_M 8)
  622. set(SBGEMM_UNROLL_N 4)
  623. set(SGEMM_UNROLL_M 16)
  624. set(SGEMM_UNROLL_N 2)
  625. set(DGEMM_UNROLL_M 8)
  626. set(DGEMM_UNROLL_N 2)
  627. set(CGEMM_UNROLL_M 2)
  628. set(CGEMM_UNROLL_N 2)
  629. set(ZGEMM_UNROLL_M 2)
  630. set(ZGEMM_UNROLL_N 2)
  631. set(CGEMM3M_UNROLL_M 8)
  632. set(CGEMM3M_UNROLL_N 4)
  633. set(ZGEMM3M_UNROLL_M 4)
  634. set(ZGEMM3M_UNROLL_N 4)
  635. elseif ("${TCORE}" STREQUAL "PILEDRIVER")
  636. file(APPEND ${TARGET_CONF_TEMP}
  637. "#define L1_DATA_SIZE\t16384\n"
  638. "#define L1_DATA_LINESIZE\t64\n"
  639. "#define L2_SIZE\t2097152\n"
  640. "#define L2_LINESIZE\t64\n"
  641. "#define DTB_DEFAULT_ENTRIES\t64\n"
  642. "#define DTB_SIZE\t4096\n"
  643. "#define HAVE_MMX\n"
  644. "#define HAVE_SSE\n"
  645. "#define HAVE_SSE2\n"
  646. "#define HAVE_SSE3\n"
  647. "#define HAVE_SSE4_1\n"
  648. "#define HAVE_SSE4_2\n"
  649. "#define HAVE_SSE4A\n"
  650. "#define HAVE_AVX\n"
  651. "#define HAVE_MISALIGNSSE\n"
  652. "#define HAVE_128BITFPU\n"
  653. "#define HAVE_FASTMOVU\n"
  654. "#define HAVE_CFLUSH\n"
  655. "#define HAVE_FMA3\n"
  656. "#define SLOCAL_BUFFER_SIZE\t6144\n"
  657. "#define DLOCAL_BUFFER_SIZE\t5376\n"
  658. "#define CLOCAL_BUFFER_SIZE\t10752\n"
  659. "#define ZLOCAL_BUFFER_SIZE\t10752\n")
  660. set(HAVE_SSE 1)
  661. set(HAVE_SSE2 1)
  662. set(HAVE_SSE3 1)
  663. set(HAVE_SSE4_1 1)
  664. set(HAVE_SSE4_2 1)
  665. set(HAVE_SSE4A 1)
  666. set(HAVE_AVX 1)
  667. set(HAVE_FMA3 1)
  668. set(HAVE_MISALIGNSSE 1)
  669. set(HAVE_128BITFPU 1)
  670. set(HAVE_FASTMOVU 1)
  671. set(HAVE_CFLUSH 1)
  672. set(SBGEMM_UNROLL_M 8)
  673. set(SBGEMM_UNROLL_N 4)
  674. set(SGEMM_UNROLL_M 16)
  675. set(SGEMM_UNROLL_N 2)
  676. set(DGEMM_UNROLL_M 8)
  677. set(DGEMM_UNROLL_N 2)
  678. set(CGEMM_UNROLL_M 4)
  679. set(CGEMM_UNROLL_N 2)
  680. set(ZGEMM_UNROLL_M 2)
  681. set(ZGEMM_UNROLL_N 2)
  682. set(CGEMM3M_UNROLL_M 8)
  683. set(CGEMM3M_UNROLL_N 4)
  684. set(ZGEMM3M_UNROLL_M 4)
  685. set(ZGEMM3M_UNROLL_N 4)
  686. elseif ("${TCORE}" STREQUAL "STEAMROLLER")
  687. file(APPEND ${TARGET_CONF_TEMP}
  688. "#define L1_DATA_SIZE\t16384\n"
  689. "#define L1_DATA_LINESIZE\t64\n"
  690. "#define L2_SIZE\t2097152\n"
  691. "#define L2_LINESIZE\t64\n"
  692. "#define DTB_DEFAULT_ENTRIES\t64\n"
  693. "#define DTB_SIZE\t4096\n"
  694. "#define HAVE_MMX\n"
  695. "#define HAVE_SSE\n"
  696. "#define HAVE_SSE2\n"
  697. "#define HAVE_SSE3\n"
  698. "#define HAVE_SSE4_1\n"
  699. "#define HAVE_SSE4_2\n"
  700. "#define HAVE_SSE4A\n"
  701. "#define HAVE_AVX\n"
  702. "#define HAVE_MISALIGNSSE\n"
  703. "#define HAVE_128BITFPU\n"
  704. "#define HAVE_FASTMOVU\n"
  705. "#define HAVE_CFLUSH\n"
  706. "#define HAVE_FMA3\n"
  707. "#define SLOCAL_BUFFER_SIZE\t6144\n"
  708. "#define DLOCAL_BUFFER_SIZE\t5120\n"
  709. "#define CLOCAL_BUFFER_SIZE\t10240\n"
  710. "#define ZLOCAL_BUFFER_SIZE\t10240\n")
  711. set(HAVE_SSE 1)
  712. set(HAVE_SSE2 1)
  713. set(HAVE_SSE3 1)
  714. set(HAVE_SSE4_1 1)
  715. set(HAVE_SSE4_2 1)
  716. set(HAVE_SSE4A 1)
  717. set(HAVE_AVX 1)
  718. set(HAVE_FMA3 1)
  719. set(HAVE_MISALIGNSSE 1)
  720. set(HAVE_128BITFPU 1)
  721. set(HAVE_FASTMOVU 1)
  722. set(HAVE_CFLUSH 1)
  723. set(SBGEMM_UNROLL_M 8)
  724. set(SBGEMM_UNROLL_N 4)
  725. set(SGEMM_UNROLL_M 16)
  726. set(SGEMM_UNROLL_N 2)
  727. set(DGEMM_UNROLL_M 8)
  728. set(DGEMM_UNROLL_N 2)
  729. set(CGEMM_UNROLL_M 4)
  730. set(CGEMM_UNROLL_N 2)
  731. set(ZGEMM_UNROLL_M 2)
  732. set(ZGEMM_UNROLL_N 2)
  733. set(CGEMM3M_UNROLL_M 8)
  734. set(CGEMM3M_UNROLL_N 4)
  735. set(ZGEMM3M_UNROLL_M 4)
  736. set(ZGEMM3M_UNROLL_N 4)
  737. elseif ("${TCORE}" STREQUAL "EXCAVATOR")
  738. file(APPEND ${TARGET_CONF_TEMP}
  739. "#define L1_DATA_SIZE\t16384\n"
  740. "#define L1_DATA_LINESIZE\t64\n"
  741. "#define L2_SIZE\t2097152\n"
  742. "#define L2_LINESIZE\t64\n"
  743. "#define DTB_DEFAULT_ENTRIES\t64\n"
  744. "#define DTB_SIZE\t4096\n"
  745. "#define HAVE_MMX\n"
  746. "#define HAVE_SSE\n"
  747. "#define HAVE_SSE2\n"
  748. "#define HAVE_SSE3\n"
  749. "#define HAVE_SSE4_1\n"
  750. "#define HAVE_SSE4_2\n"
  751. "#define HAVE_SSE4A\n"
  752. "#define HAVE_AVX\n"
  753. "#define HAVE_MISALIGNSSE\n"
  754. "#define HAVE_128BITFPU\n"
  755. "#define HAVE_FASTMOVU\n"
  756. "#define HAVE_CFLUSH\n"
  757. "#define HAVE_FMA3\n"
  758. "#define SLOCAL_BUFFER_SIZE\t6144\n"
  759. "#define DLOCAL_BUFFER_SIZE\t5120\n"
  760. "#define CLOCAL_BUFFER_SIZE\t10240\n"
  761. "#define ZLOCAL_BUFFER_SIZE\t10240\n")
  762. set(HAVE_SSE 1)
  763. set(HAVE_SSE2 1)
  764. set(HAVE_SSE3 1)
  765. set(HAVE_SSE4_1 1)
  766. set(HAVE_SSE4_2 1)
  767. set(HAVE_SSE4A 1)
  768. set(HAVE_AVX 1)
  769. set(HAVE_FMA3 1)
  770. set(HAVE_MISALIGNSSE 1)
  771. set(HAVE_128BITFPU 1)
  772. set(HAVE_FASTMOVU 1)
  773. set(HAVE_CFLUSH 1)
  774. set(SBGEMM_UNROLL_M 8)
  775. set(SBGEMM_UNROLL_N 4)
  776. set(SGEMM_UNROLL_M 16)
  777. set(SGEMM_UNROLL_N 2)
  778. set(DGEMM_UNROLL_M 8)
  779. set(DGEMM_UNROLL_N 2)
  780. set(CGEMM_UNROLL_M 4)
  781. set(CGEMM_UNROLL_N 2)
  782. set(ZGEMM_UNROLL_M 2)
  783. set(ZGEMM_UNROLL_N 2)
  784. set(CGEMM3M_UNROLL_M 8)
  785. set(CGEMM3M_UNROLL_N 4)
  786. set(ZGEMM3M_UNROLL_M 4)
  787. set(ZGEMM3M_UNROLL_N 4)
  788. elseif ("${TCORE}" STREQUAL "ZEN")
  789. file(APPEND ${TARGET_CONF_TEMP}
  790. "#define L1_DATA_SIZE\t32768\n"
  791. "#define L1_DATA_LINESIZE\t64\n"
  792. "#define L2_SIZE\t524288\n"
  793. "#define L2_LINESIZE\t64\n"
  794. "#define DTB_DEFAULT_ENTRIES\t64\n"
  795. "#define DTB_SIZE\t4096\n"
  796. "#define HAVE_MMX\n"
  797. "#define HAVE_SSE\n"
  798. "#define HAVE_SSE2\n"
  799. "#define HAVE_SSE3\n"
  800. "#define HAVE_SSE4_1\n"
  801. "#define HAVE_SSE4_2\n"
  802. "#define HAVE_SSE4A\n"
  803. "#define HAVE_MISALIGNSSE\n"
  804. "#define HAVE_128BITFPU\n"
  805. "#define HAVE_FASTMOVU\n"
  806. "#define HAVE_CFLUSH\n"
  807. "#define HAVE_AVX\n"
  808. "#define HAVE_AVX2\n"
  809. "#define HAVE_FMA3\n"
  810. "#define SLOCAL_BUFFER_SIZE\t20480\n"
  811. "#define DLOCAL_BUFFER_SIZE\t32768\n"
  812. "#define CLOCAL_BUFFER_SIZE\t16384\n"
  813. "#define ZLOCAL_BUFFER_SIZE\t12288\n")
  814. set(HAVE_SSE 1)
  815. set(HAVE_SSE2 1)
  816. set(HAVE_SSE3 1)
  817. set(HAVE_SSE4_1 1)
  818. set(HAVE_SSE4_2 1)
  819. set(HAVE_AVX 1)
  820. set(HAVE_AVX2 1)
  821. set(HAVE_FMA3 1)
  822. set(HAVE_SSE4A 1)
  823. set(HAVE_MISALIGNSSE 1)
  824. set(HAVE_128BITFPU 1)
  825. set(HAVE_FASTMOVU 1)
  826. set(HAVE_CFLUSH 1)
  827. set(SBGEMM_UNROLL_M 8)
  828. set(SBGEMM_UNROLL_N 4)
  829. set(SGEMM_UNROLL_M 8)
  830. set(SGEMM_UNROLL_N 4)
  831. set(DGEMM_UNROLL_M 4)
  832. set(DGEMM_UNROLL_N 8)
  833. set(CGEMM_UNROLL_M 8)
  834. set(CGEMM_UNROLL_N 2)
  835. set(ZGEMM_UNROLL_M 4)
  836. set(ZGEMM_UNROLL_N 2)
  837. set(CGEMM3M_UNROLL_M 8)
  838. set(CGEMM3M_UNROLL_N 4)
  839. set(ZGEMM3M_UNROLL_M 4)
  840. set(ZGEMM3M_UNROLL_N 4)
  841. elseif ("${TCORE}" STREQUAL "ARMV5")
  842. file(APPEND ${TARGET_CONF_TEMP}
  843. "#define L1_DATA_SIZE\t65536\n"
  844. "#define L1_DATA_LINESIZE\t32\n"
  845. "#define L2_SIZE\t512488\n"
  846. "#define L2_LINESIZE\t32\n"
  847. "#define DTB_DEFAULT_ENTRIES\t64\n"
  848. "#define DTB_SIZE\t4096\n"
  849. "#define L2_ASSOCIATIVE\t4\n")
  850. set(SGEMM_UNROLL_M 2)
  851. set(SGEMM_UNROLL_N 2)
  852. set(DGEMM_UNROLL_M 2)
  853. set(DGEMM_UNROLL_N 2)
  854. set(CGEMM_UNROLL_M 2)
  855. set(CGEMM_UNROLL_N 2)
  856. set(ZGEMM_UNROLL_M 2)
  857. set(ZGEMM_UNROLL_N 2)
  858. elseif ("${TCORE}" STREQUAL "ARMV6")
  859. file(APPEND ${TARGET_CONF_TEMP}
  860. "#define L1_DATA_SIZE\t65536\n"
  861. "#define L1_DATA_LINESIZE\t32\n"
  862. "#define L2_SIZE\t512488\n"
  863. "#define L2_LINESIZE\t32\n"
  864. "#define DTB_DEFAULT_ENTRIES\t64\n"
  865. "#define DTB_SIZE\t4096\n"
  866. "#define L2_ASSOCIATIVE\t4\n"
  867. "#define HAVE_VFP\n")
  868. set(SGEMM_UNROLL_M 4)
  869. set(SGEMM_UNROLL_N 2)
  870. set(DGEMM_UNROLL_M 4)
  871. set(DGEMM_UNROLL_N 2)
  872. set(CGEMM_UNROLL_M 2)
  873. set(CGEMM_UNROLL_N 2)
  874. set(ZGEMM_UNROLL_M 2)
  875. set(ZGEMM_UNROLL_N 2)
  876. elseif ("${TCORE}" STREQUAL "ARMV7")
  877. file(APPEND ${TARGET_CONF_TEMP}
  878. "#define L1_DATA_SIZE\t65536\n"
  879. "#define L1_DATA_LINESIZE\t32\n"
  880. "#define L2_SIZE\t512488\n"
  881. "#define L2_LINESIZE\t32\n"
  882. "#define DTB_DEFAULT_ENTRIES\t64\n"
  883. "#define DTB_SIZE\t4096\n"
  884. "#define L2_ASSOCIATIVE\t4\n"
  885. "#define HAVE_VFPV3\n"
  886. "#define HAVE_VFP\n")
  887. set(SGEMM_UNROLL_M 4)
  888. set(SGEMM_UNROLL_N 4)
  889. set(DGEMM_UNROLL_M 4)
  890. set(DGEMM_UNROLL_N 4)
  891. set(CGEMM_UNROLL_M 2)
  892. set(CGEMM_UNROLL_N 2)
  893. set(ZGEMM_UNROLL_M 2)
  894. set(ZGEMM_UNROLL_N 2)
  895. elseif ("${TCORE}" STREQUAL "ARMV8")
  896. file(APPEND ${TARGET_CONF_TEMP}
  897. "#define L1_DATA_SIZE\t32768\n"
  898. "#define L1_DATA_LINESIZE\t64\n"
  899. "#define L2_SIZE\t262144\n"
  900. "#define L2_LINESIZE\t64\n"
  901. "#define DTB_DEFAULT_ENTRIES\t64\n"
  902. "#define DTB_SIZE\t4096\n"
  903. "#define L2_ASSOCIATIVE\t32\n"
  904. "#define ARMV8\n")
  905. set(SGEMM_UNROLL_M 16)
  906. set(SGEMM_UNROLL_N 4)
  907. set(DGEMM_UNROLL_M 8)
  908. set(DGEMM_UNROLL_N 4)
  909. set(CGEMM_UNROLL_M 8)
  910. set(CGEMM_UNROLL_N 4)
  911. set(ZGEMM_UNROLL_M 4)
  912. set(ZGEMM_UNROLL_N 4)
  913. set(SYMV_P 16)
  914. elseif ("${TCORE}" STREQUAL "CORTEXA57" OR "${TCORE}" STREQUAL "CORTEXA53" OR "${TCORE}" STREQUAL "CORTEXA55")
  915. file(APPEND ${TARGET_CONF_TEMP}
  916. "#define L1_CODE_SIZE\t32768\n"
  917. "#define L1_CODE_LINESIZE\t64\n"
  918. "#define L1_CODE_ASSOCIATIVE\t3\n"
  919. "#define L1_DATA_SIZE\t32768\n"
  920. "#define L1_DATA_LINESIZE\t64\n"
  921. "#define L1_DATA_ASSOCIATIVE\t2\n"
  922. "#define L2_SIZE\t262144\n"
  923. "#define L2_LINESIZE\t64\n"
  924. "#define L2_ASSOCIATIVE\t16\n"
  925. "#define DTB_DEFAULT_ENTRIES\t64\n"
  926. "#define DTB_SIZE\t4096\n"
  927. "#define HAVE_VFPV4\n"
  928. "#define HAVE_VFPV3\n"
  929. "#define HAVE_VFP\n"
  930. "#define HAVE_NEON\n"
  931. "#define ARMV8\n")
  932. if ("${TCORE}" STREQUAL "CORTEXA57")
  933. set(SGEMM_UNROLL_M 16)
  934. set(SGEMM_UNROLL_N 4)
  935. else ()
  936. set(SGEMM_UNROLL_M 8)
  937. set(SGEMM_UNROLL_N 8)
  938. endif ()
  939. if ("${TCORE}" STREQUAL "CORTEXA53")
  940. set(DGEMM_UNROLL_M 4)
  941. else ()
  942. set(DGEMM_UNROLL_M 8)
  943. endif ()
  944. set(DGEMM_UNROLL_N 4)
  945. set(CGEMM_UNROLL_M 8)
  946. set(CGEMM_UNROLL_N 4)
  947. set(ZGEMM_UNROLL_M 4)
  948. set(ZGEMM_UNROLL_N 4)
  949. set(SYMV_P 16)
  950. elseif ("${TCORE}" STREQUAL "CORTEXA72" OR "${TCORE}" STREQUAL "CORTEXA73" OR "${TCORE}" STREQUAL "CORTEXA76")
  951. file(APPEND ${TARGET_CONF_TEMP}
  952. "#define L1_CODE_SIZE\t49152\n"
  953. "#define L1_CODE_LINESIZE\t64\n"
  954. "#define L1_CODE_ASSOCIATIVE\t3\n"
  955. "#define L1_DATA_SIZE\t32768\n"
  956. "#define L1_DATA_LINESIZE\t64\n"
  957. "#define L1_DATA_ASSOCIATIVE\t2\n"
  958. "#define L2_SIZE\t524288\n"
  959. "#define L2_LINESIZE\t64\n"
  960. "#define L2_ASSOCIATIVE\t16\n"
  961. "#define DTB_DEFAULT_ENTRIES\t64\n"
  962. "#define DTB_SIZE\t4096\n"
  963. "#define HAVE_VFPV4\n"
  964. "#define HAVE_VFPV3\n"
  965. "#define HAVE_VFP\n"
  966. "#define HAVE_NEON\n"
  967. "#define ARMV8\n")
  968. set(SGEMM_UNROLL_M 16)
  969. set(SGEMM_UNROLL_N 4)
  970. set(DGEMM_UNROLL_M 8)
  971. set(DGEMM_UNROLL_N 4)
  972. set(CGEMM_UNROLL_M 8)
  973. set(CGEMM_UNROLL_N 4)
  974. set(ZGEMM_UNROLL_M 4)
  975. set(ZGEMM_UNROLL_N 4)
  976. set(SYMV_P 16)
  977. elseif ("${TCORE}" STREQUAL "NEOVERSEN1")
  978. file(APPEND ${TARGET_CONF_TEMP}
  979. "#define L1_CODE_SIZE\t65536\n"
  980. "#define L1_CODE_LINESIZE\t64\n"
  981. "#define L1_CODE_ASSOCIATIVE\t4\n"
  982. "#define L1_DATA_SIZE\t65536\n"
  983. "#define L1_DATA_LINESIZE\t64\n"
  984. "#define L1_DATA_ASSOCIATIVE\t4\n"
  985. "#define L2_SIZE\t1048576\n\n"
  986. "#define L2_LINESIZE\t64\n"
  987. "#define L2_ASSOCIATIVE\t8\n"
  988. "#define DTB_DEFAULT_ENTRIES\t48\n"
  989. "#define DTB_SIZE\t4096\n"
  990. "#define HAVE_VFPV4\n"
  991. "#define HAVE_VFPV3\n"
  992. "#define HAVE_VFP\n"
  993. "#define HAVE_NEON\n"
  994. "#define ARMV8\n")
  995. set(SGEMM_UNROLL_M 16)
  996. set(SGEMM_UNROLL_N 4)
  997. set(DGEMM_UNROLL_M 8)
  998. set(DGEMM_UNROLL_N 4)
  999. set(CGEMM_UNROLL_M 8)
  1000. set(CGEMM_UNROLL_N 4)
  1001. set(ZGEMM_UNROLL_M 4)
  1002. set(ZGEMM_UNROLL_N 4)
  1003. set(SYMV_P 16)
  1004. elseif ("${TCORE}" STREQUAL "NEOVERSEV1")
  1005. file(APPEND ${TARGET_CONF_TEMP}
  1006. "#define L1_CODE_SIZE\t65536\n"
  1007. "#define L1_CODE_LINESIZE\t64\n"
  1008. "#define L1_CODE_ASSOCIATIVE\t4\n"
  1009. "#define L1_DATA_SIZE\t65536\n"
  1010. "#define L1_DATA_LINESIZE\t64\n"
  1011. "#define L1_DATA_ASSOCIATIVE\t4\n"
  1012. "#define L2_SIZE\t1048576\n\n"
  1013. "#define L2_LINESIZE\t64\n"
  1014. "#define L2_ASSOCIATIVE\t8\n"
  1015. "#define DTB_DEFAULT_ENTRIES\t48\n"
  1016. "#define DTB_SIZE\t4096\n"
  1017. "#define HAVE_VFPV4\n"
  1018. "#define HAVE_VFPV3\n"
  1019. "#define HAVE_VFP\n"
  1020. "#define HAVE_NEON\n"
  1021. "#define HAVE_SVE\n"
  1022. "#define ARMV8\n")
  1023. set(SGEMM_UNROLL_M 16)
  1024. set(SGEMM_UNROLL_N 8)
  1025. set(DGEMM_UNROLL_M 4)
  1026. set(DGEMM_UNROLL_N 8)
  1027. set(CGEMM_UNROLL_M 2)
  1028. set(CGEMM_UNROLL_N 4)
  1029. set(ZGEMM_UNROLL_M 2)
  1030. set(ZGEMM_UNROLL_N 4)
  1031. set(SYMV_P 16)
  1032. elseif ("${TCORE}" STREQUAL "NEOVERSEN2" OR "${TCORE}" STREQUAL "ARMV9SME")
  1033. file(APPEND ${TARGET_CONF_TEMP}
  1034. "#define L1_CODE_SIZE\t65536\n"
  1035. "#define L1_CODE_LINESIZE\t64\n"
  1036. "#define L1_CODE_ASSOCIATIVE\t4\n"
  1037. "#define L1_DATA_SIZE\t65536\n"
  1038. "#define L1_DATA_LINESIZE\t64\n"
  1039. "#define L1_DATA_ASSOCIATIVE\t2\n"
  1040. "#define L2_SIZE\t1048576\n\n"
  1041. "#define L2_LINESIZE\t64\n"
  1042. "#define L2_ASSOCIATIVE\t8\n"
  1043. "#define DTB_DEFAULT_ENTRIES\t48\n"
  1044. "#define DTB_SIZE\t4096\n"
  1045. "#define HAVE_VFPV4\n"
  1046. "#define HAVE_VFPV3\n"
  1047. "#define HAVE_VFP\n"
  1048. "#define HAVE_NEON\n"
  1049. "#define HAVE_SVE\n"
  1050. "#define ARMV8\n")
  1051. set(SGEMM_UNROLL_M 16)
  1052. set(SGEMM_UNROLL_N 4)
  1053. set(DGEMM_UNROLL_M 8)
  1054. set(DGEMM_UNROLL_N 4)
  1055. set(CGEMM_UNROLL_M 8)
  1056. set(CGEMM_UNROLL_N 4)
  1057. set(ZGEMM_UNROLL_M 4)
  1058. set(ZGEMM_UNROLL_N 4)
  1059. set(SYMV_P 16)
  1060. elseif ("${TCORE}" STREQUAL "FALKOR")
  1061. file(APPEND ${TARGET_CONF_TEMP}
  1062. "#define L1_CODE_SIZE\t65536\n"
  1063. "#define L1_CODE_LINESIZE\t64\n"
  1064. "#define L1_CODE_ASSOCIATIVE\t3\n"
  1065. "#define L1_DATA_SIZE\t32768\n"
  1066. "#define L1_DATA_LINESIZE\t128\n"
  1067. "#define L1_DATA_ASSOCIATIVE\t2\n"
  1068. "#define L2_SIZE\t524288\n"
  1069. "#define L2_LINESIZE\t64\n"
  1070. "#define L2_ASSOCIATIVE\t16\n"
  1071. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1072. "#define DTB_SIZE\t4096\n"
  1073. "#define HAVE_VFPV4\n"
  1074. "#define HAVE_VFPV3\n"
  1075. "#define HAVE_VFP\n"
  1076. "#define HAVE_NEON\n"
  1077. "#define ARMV8\n")
  1078. set(SGEMM_UNROLL_M 16)
  1079. set(SGEMM_UNROLL_N 4)
  1080. set(DGEMM_UNROLL_M 8)
  1081. set(DGEMM_UNROLL_N 4)
  1082. set(CGEMM_UNROLL_M 8)
  1083. set(CGEMM_UNROLL_N 4)
  1084. set(ZGEMM_UNROLL_M 4)
  1085. set(ZGEMM_UNROLL_N 4)
  1086. set(SYMV_P 16)
  1087. elseif ("${TCORE}" STREQUAL "THUNDERX")
  1088. file(APPEND ${TARGET_CONF_TEMP}
  1089. "#define L1_CODE_SIZE\t32768\n"
  1090. "#define L1_CODE_LINESIZE\t64\n"
  1091. "#define L1_CODE_ASSOCIATIVE\t3\n"
  1092. "#define L1_DATA_SIZE\t32768\n"
  1093. "#define L1_DATA_LINESIZE\t128\n"
  1094. "#define L1_DATA_ASSOCIATIVE\t2\n"
  1095. "#define L2_SIZE\t167772164\n"
  1096. "#define L2_LINESIZE\t128\n"
  1097. "#define L2_ASSOCIATIVE\t16\n"
  1098. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1099. "#define DTB_SIZE\t4096\n"
  1100. "#define HAVE_VFPV4\n"
  1101. "#define HAVE_VFPV3\n"
  1102. "#define HAVE_VFP\n"
  1103. "#define HAVE_NEON\n"
  1104. "#define ARMV8\n")
  1105. set(SGEMM_UNROLL_M 4)
  1106. set(SGEMM_UNROLL_N 4)
  1107. set(DGEMM_UNROLL_M 2)
  1108. set(DGEMM_UNROLL_N 2)
  1109. set(CGEMM_UNROLL_M 2)
  1110. set(CGEMM_UNROLL_N 2)
  1111. set(ZGEMM_UNROLL_M 2)
  1112. set(ZGEMM_UNROLL_N 2)
  1113. set(SYMV_P 16)
  1114. elseif ("${TCORE}" STREQUAL "THUNDERX2T99")
  1115. file(APPEND ${TARGET_CONF_TEMP}
  1116. "#define L1_CODE_SIZE\t32768\n"
  1117. "#define L1_CODE_LINESIZE\t64\n"
  1118. "#define L1_CODE_ASSOCIATIVE\t8\n"
  1119. "#define L1_DATA_SIZE\t32768\n"
  1120. "#define L1_DATA_LINESIZE\t64\n"
  1121. "#define L1_DATA_ASSOCIATIVE\t8\n"
  1122. "#define L2_SIZE\t262144\n"
  1123. "#define L2_LINESIZE\t64\n"
  1124. "#define L2_ASSOCIATIVE\t8\n"
  1125. "#define L3_SIZE\t33554432\n"
  1126. "#define L3_LINESIZE\t64\n"
  1127. "#define L3_ASSOCIATIVE\t32\n"
  1128. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1129. "#define DTB_SIZE\t4096\n"
  1130. "#define ARMV8\n")
  1131. set(SGEMM_UNROLL_M 16)
  1132. set(SGEMM_UNROLL_N 4)
  1133. set(DGEMM_UNROLL_M 8)
  1134. set(DGEMM_UNROLL_N 4)
  1135. set(CGEMM_UNROLL_M 8)
  1136. set(CGEMM_UNROLL_N 4)
  1137. set(ZGEMM_UNROLL_M 4)
  1138. set(ZGEMM_UNROLL_N 4)
  1139. set(SYMV_P 16)
  1140. elseif ("${TCORE}" STREQUAL "THUNDERX3T110")
  1141. file(APPEND ${TARGET_CONF_TEMP}
  1142. "#define THUNDERX3T110\n"
  1143. "#define L1_CODE_SIZE\t65536\n"
  1144. "#define L1_CODE_LINESIZE\t64\n"
  1145. "#define L1_CODE_ASSOCIATIVE\t8\n"
  1146. "#define L1_DATA_SIZE\t65536\n"
  1147. "#define L1_DATA_LINESIZE\t64\n"
  1148. "#define L1_DATA_ASSOCIATIVE\t8\n"
  1149. "#define L2_SIZE\t524288\n"
  1150. "#define L2_LINESIZE\t64\n"
  1151. "#define L2_ASSOCIATIVE\t8\n"
  1152. "#define L3_SIZE\t94371840\n"
  1153. "#define L3_LINESIZE\t64\n"
  1154. "#define L3_ASSOCIATIVE\t32\n"
  1155. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1156. "#define DTB_SIZE\t4096\n"
  1157. "#define ARMV8\n")
  1158. set(SGEMM_UNROLL_M 16)
  1159. set(SGEMM_UNROLL_N 4)
  1160. set(DGEMM_UNROLL_M 8)
  1161. set(DGEMM_UNROLL_N 4)
  1162. set(CGEMM_UNROLL_M 8)
  1163. set(CGEMM_UNROLL_N 4)
  1164. set(ZGEMM_UNROLL_M 4)
  1165. set(ZGEMM_UNROLL_N 4)
  1166. set(SYMV_P 16)
  1167. elseif ("${TCORE}" STREQUAL "TSV110")
  1168. file(APPEND ${TARGET_CONF_TEMP}
  1169. "#define ARMV8\n"
  1170. "#define L1_CODE_SIZE\t65536\n"
  1171. "#define L1_CODE_LINESIZE\t64\n"
  1172. "#define L1_CODE_ASSOCIATIVE\t4\n"
  1173. "#define L1_DATA_SIZE\t65536\n"
  1174. "#define L1_DATA_LINESIZE\t64\n"
  1175. "#define L1_DATA_ASSOCIATIVE\t4\n"
  1176. "#define L2_SIZE\t524288\n"
  1177. "#define L2_LINESIZE\t64\n"
  1178. "#define L2_ASSOCIATIVE\t8\n"
  1179. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1180. "#define DTB_SIZE\t4096\n")
  1181. set(SGEMM_UNROLL_M 16)
  1182. set(SGEMM_UNROLL_N 4)
  1183. set(DGEMM_UNROLL_M 8)
  1184. set(DGEMM_UNROLL_N 4)
  1185. set(CGEMM_UNROLL_M 8)
  1186. set(CGEMM_UNROLL_N 4)
  1187. set(ZGEMM_UNROLL_M 4)
  1188. set(ZGEMM_UNROLL_N 4)
  1189. set(SYMV_P 16)
  1190. elseif ("${TCORE}" STREQUAL "EMAG8180")
  1191. file(APPEND ${TARGET_CONF_TEMP}
  1192. "#define ARMV8\n"
  1193. "#define L1_CODE_SIZE\t32768\n"
  1194. "#define L1_CODE_LINESIZE\t64\n"
  1195. "#define L1_CODE_ASSOCIATIVE\t4\n"
  1196. "#define L1_DATA_SIZE\t32768\n"
  1197. "#define L1_DATA_LINESIZE\t64\n"
  1198. "#define L1_DATA_ASSOCIATIVE\t4\n"
  1199. "#define L2_SIZE\t5262144\n"
  1200. "#define L2_LINESIZE\t64\n"
  1201. "#define L2_ASSOCIATIVE\t8\n"
  1202. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1203. "#define DTB_SIZE\t4096\n")
  1204. set(SGEMM_UNROLL_M 16)
  1205. set(SGEMM_UNROLL_N 4)
  1206. set(DGEMM_UNROLL_M 8)
  1207. set(DGEMM_UNROLL_N 4)
  1208. set(CGEMM_UNROLL_M 8)
  1209. set(CGEMM_UNROLL_N 4)
  1210. set(ZGEMM_UNROLL_M 4)
  1211. set(ZGEMM_UNROLL_N 4)
  1212. set(SYMV_P 16)
  1213. elseif ("${TCORE}" STREQUAL "AMPEREONE")
  1214. file(APPEND ${TARGET_CONF_TEMP}
  1215. "#define L1_CODE_SIZE\t16384\n"
  1216. "#define L1_CODE_LINESIZE\t64\n"
  1217. "#define L1_CODE_ASSOCIATIVE\t4\n"
  1218. "#define L1_DATA_SIZE\t65536\n"
  1219. "#define L1_DATA_LINESIZE\t64\n"
  1220. "#define L1_DATA_ASSOCIATIVE\t4\n"
  1221. "#define L2_SIZE\t2097152\n\n"
  1222. "#define L2_LINESIZE\t64\n"
  1223. "#define L2_ASSOCIATIVE\t8\n"
  1224. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1225. "#define DTB_SIZE\t4096\n"
  1226. "#define HAVE_VFPV4\n"
  1227. "#define HAVE_VFPV3\n"
  1228. "#define HAVE_VFP\n"
  1229. "#define HAVE_NEON\n"
  1230. "#define ARMV8\n")
  1231. set(SGEMM_UNROLL_M 16)
  1232. set(SGEMM_UNROLL_N 4)
  1233. set(DGEMM_UNROLL_M 8)
  1234. set(DGEMM_UNROLL_N 4)
  1235. set(CGEMM_UNROLL_M 8)
  1236. set(CGEMM_UNROLL_N 4)
  1237. set(ZGEMM_UNROLL_M 4)
  1238. set(ZGEMM_UNROLL_N 4)
  1239. set(SYMV_P 16)
  1240. elseif ("${TCORE}" STREQUAL "VORTEX")
  1241. file(APPEND ${TARGET_CONF_TEMP}
  1242. "#define ARMV8\n"
  1243. "#define L1_CODE_SIZE\t32768\n"
  1244. "#define L1_CODE_LINESIZE\t64\n"
  1245. "#define L1_CODE_ASSOCIATIVE\t4\n"
  1246. "#define L1_DATA_SIZE\t32768\n"
  1247. "#define L1_DATA_LINESIZE\t64\n"
  1248. "#define L1_DATA_ASSOCIATIVE\t4\n"
  1249. "#define L2_SIZE\t5262144\n"
  1250. "#define L2_LINESIZE\t64\n"
  1251. "#define L2_ASSOCIATIVE\t8\n"
  1252. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1253. "#define DTB_SIZE\t4096\n")
  1254. set(SGEMM_UNROLL_M 16)
  1255. set(SGEMM_UNROLL_N 4)
  1256. set(DGEMM_UNROLL_M 8)
  1257. set(DGEMM_UNROLL_N 4)
  1258. set(CGEMM_UNROLL_M 8)
  1259. set(CGEMM_UNROLL_N 4)
  1260. set(ZGEMM_UNROLL_M 4)
  1261. set(ZGEMM_UNROLL_N 4)
  1262. set(SYMV_P 16)
  1263. elseif ("${TCORE}" STREQUAL "A64FX")
  1264. file(APPEND ${TARGET_CONF_TEMP}
  1265. "#define L1_CODE_SIZE\t65536\n"
  1266. "#define L1_CODE_LINESIZE\t256\n"
  1267. "#define L1_CODE_ASSOCIATIVE\t8\n"
  1268. "#define L1_DATA_SIZE\t32768\n"
  1269. "#define L1_DATA_LINESIZE\t256\n"
  1270. "#define L1_DATA_ASSOCIATIVE\t8\n"
  1271. "#define L2_SIZE\t8388608\n\n"
  1272. "#define L2_LINESIZE\t256\n"
  1273. "#define L2_ASSOCIATIVE\t8\n"
  1274. "#define L3_SIZE\t0\n\n"
  1275. "#define L3_LINESIZE\t0\n\n"
  1276. "#define L3_ASSOCIATIVE\t0\n\n"
  1277. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1278. "#define DTB_SIZE\t4096\n"
  1279. "#define HAVE_VFPV4\n"
  1280. "#define HAVE_VFPV3\n"
  1281. "#define HAVE_VFP\n"
  1282. "#define HAVE_NEON\n"
  1283. "#define HAVE_SVE\n"
  1284. "#define ARMV8\n")
  1285. set(SGEMM_UNROLL_M 4)
  1286. set(SGEMM_UNROLL_N 8)
  1287. set(DGEMM_UNROLL_M 2)
  1288. set(DGEMM_UNROLL_N 8)
  1289. set(CGEMM_UNROLL_M 2)
  1290. set(CGEMM_UNROLL_N 4)
  1291. set(ZGEMM_UNROLL_M 2)
  1292. set(ZGEMM_UNROLL_N 4)
  1293. set(SYMV_P 16)
  1294. elseif ("${TCORE}" STREQUAL "ARMV8SVE" OR "${TCORE}" STREQUAL "CORTEXA510" OR "${TCORE}" STREQUAL "CORTEXX2" OR "${TCORE}" STREQUAL "ARMV9")
  1295. file(APPEND ${TARGET_CONF_TEMP}
  1296. "#define L1_DATA_SIZE\t32768\n"
  1297. "#define L1_DATA_LINESIZE\t64\n"
  1298. "#define L2_SIZE\t1048576\n"
  1299. "#define L2_LINESIZE\t64\n"
  1300. "#define DTB_DEFAULT_ENTRIES\t64\n"
  1301. "#define DTB_SIZE\t4096\n"
  1302. "#define L2_ASSOCIATIVE\t32\n"
  1303. "#define ARMV8\n")
  1304. set(SGEMM_UNROLL_M 4)
  1305. set(SGEMM_UNROLL_N 8)
  1306. set(DGEMM_UNROLL_M 4)
  1307. set(DGEMM_UNROLL_N 8)
  1308. set(CGEMM_UNROLL_M 2)
  1309. set(CGEMM_UNROLL_N 4)
  1310. set(ZGEMM_UNROLL_M 2)
  1311. set(ZGEMM_UNROLL_N 4)
  1312. set(SYMV_P 16)
  1313. elseif ("${TCORE}" STREQUAL "P5600")
  1314. file(APPEND ${TARGET_CONF_TEMP}
  1315. "#define L2_SIZE 1048576\n"
  1316. "#define DTB_SIZE 4096\n"
  1317. "#define DTB_DEFAULT_ENTRIES 64\n")
  1318. set(SGEMM_UNROLL_M 2)
  1319. set(SGEMM_UNROLL_N 2)
  1320. set(DGEMM_UNROLL_M 2)
  1321. set(DGEMM_UNROLL_N 2)
  1322. set(CGEMM_UNROLL_M 2)
  1323. set(CGEMM_UNROLL_N 2)
  1324. set(ZGEMM_UNROLL_M 2)
  1325. set(ZGEMM_UNROLL_N 2)
  1326. set(SYMV_P 16)
  1327. elseif ("${TCORE}" MATCHES "MIPS")
  1328. file(APPEND ${TARGET_CONF_TEMP}
  1329. "#define L2_SIZE 262144\n"
  1330. "#define DTB_SIZE 4096\n"
  1331. "#define DTB_DEFAULT_ENTRIES 64\n")
  1332. set(SGEMM_UNROLL_M 2)
  1333. set(SGEMM_UNROLL_N 2)
  1334. set(DGEMM_UNROLL_M 2)
  1335. set(DGEMM_UNROLL_N 2)
  1336. set(CGEMM_UNROLL_M 2)
  1337. set(CGEMM_UNROLL_N 2)
  1338. set(ZGEMM_UNROLL_M 2)
  1339. set(ZGEMM_UNROLL_N 2)
  1340. set(SYMV_P 16)
  1341. elseif ("${TCORE}" STREQUAL "POWER6")
  1342. file(APPEND ${TARGET_CONF_TEMP}
  1343. "#define L1_DATA_SIZE 32768\n"
  1344. "#define L1_DATA_LINESIZE 128\n"
  1345. "#define L2_SIZE 524288\n"
  1346. "#define L2_LINESIZE 128 \n"
  1347. "#define DTB_DEFAULT_ENTRIES 128\n"
  1348. "#define DTB_SIZE 4096\n"
  1349. "#define L2_ASSOCIATIVE 8\n")
  1350. set(SGEMM_UNROLL_M 4)
  1351. set(SGEMM_UNROLL_N 4)
  1352. set(DGEMM_UNROLL_M 4)
  1353. set(DGEMM_UNROLL_N 4)
  1354. set(CGEMM_UNROLL_M 2)
  1355. set(CGEMM_UNROLL_N 4)
  1356. set(ZGEMM_UNROLL_M 2)
  1357. set(ZGEMM_UNROLL_N 4)
  1358. set(SYMV_P 8)
  1359. elseif ("${TCORE}" STREQUAL "POWER8")
  1360. file(APPEND ${TARGET_CONF_TEMP}
  1361. "#define L1_DATA_SIZE 32768\n"
  1362. "#define L1_DATA_LINESIZE 128\n"
  1363. "#define L2_SIZE 524288\n"
  1364. "#define L2_LINESIZE 128 \n"
  1365. "#define DTB_DEFAULT_ENTRIES 128\n"
  1366. "#define DTB_SIZE 4096\n"
  1367. "#define L2_ASSOCIATIVE 8\n")
  1368. set(SGEMM_UNROLL_M 16)
  1369. set(SGEMM_UNROLL_N 8)
  1370. set(DGEMM_UNROLL_M 16)
  1371. set(DGEMM_UNROLL_N 4)
  1372. set(CGEMM_UNROLL_M 8)
  1373. set(CGEMM_UNROLL_N 4)
  1374. set(ZGEMM_UNROLL_M 8)
  1375. set(ZGEMM_UNROLL_N 2)
  1376. set(SYMV_P 8)
  1377. elseif ("${TCORE}" STREQUAL "POWER9" OR "${TCORE}" STREQUAL "POWER10")
  1378. file(APPEND ${TARGET_CONF_TEMP}
  1379. "#define L1_DATA_SIZE 32768\n"
  1380. "#define L1_DATA_LINESIZE 128\n"
  1381. "#define L2_SIZE 524288\n"
  1382. "#define L2_LINESIZE 128 \n"
  1383. "#define DTB_DEFAULT_ENTRIES 128\n"
  1384. "#define DTB_SIZE 4096\n"
  1385. "#define L2_ASSOCIATIVE 8\n")
  1386. set(SGEMM_UNROLL_M 16)
  1387. set(SGEMM_UNROLL_N 8)
  1388. set(DGEMM_UNROLL_M 16)
  1389. set(DGEMM_UNROLL_N 4)
  1390. set(CGEMM_UNROLL_M 8)
  1391. set(CGEMM_UNROLL_N 4)
  1392. set(ZGEMM_UNROLL_M 8)
  1393. set(ZGEMM_UNROLL_N 2)
  1394. set(SYMV_P 8)
  1395. elseif ("${TCORE}" STREQUAL "C910V")
  1396. file(APPEND ${TARGET_CONF_TEMP}
  1397. "#define L1_DATA_SIZE 32768\n"
  1398. "#define L1_DATA_LINESIZE 32\n"
  1399. "#define L2_SIZE 1048576\n"
  1400. "#define L2_LINESIZE 32 \n"
  1401. "#define DTB_DEFAULT_ENTRIES 128\n"
  1402. "#define DTB_SIZE 4096\n"
  1403. "#define L2_ASSOCIATIVE 4\n")
  1404. set(SGEMM_UNROLL_M 16)
  1405. set(SGEMM_UNROLL_N 4)
  1406. set(DGEMM_UNROLL_M 8)
  1407. set(DGEMM_UNROLL_N 4)
  1408. set(CGEMM_UNROLL_M 2)
  1409. set(CGEMM_UNROLL_N 2)
  1410. set(ZGEMM_UNROLL_M 2)
  1411. set(ZGEMM_UNROLL_N 2)
  1412. set(SYMV_P 16)
  1413. elseif ("${TCORE}" STREQUAL "x280")
  1414. file(APPEND ${TARGET_CONF_TEMP}
  1415. "#define L1_DATA_SIZE 65536\n"
  1416. "#define L1_LINESIZE 32 \n"
  1417. "#define L2_SIZE 2097152\n"
  1418. "#define L2_LINESIZE 32 \n"
  1419. "#define DTB_DEFAULT_ENTRIES 128\n"
  1420. "#define DTB_SIZE 4096\n"
  1421. "#define L2_ASSOCIATIVE 4\n")
  1422. set(SGEMM_UNROLL_M 16)
  1423. set(SGEMM_UNROLL_N 8)
  1424. set(DGEMM_UNROLL_M 16)
  1425. set(DGEMM_UNROLL_N 8)
  1426. set(CGEMM_UNROLL_M 8)
  1427. set(CGEMM_UNROLL_N 4)
  1428. set(ZGEMM_UNROLL_M 8)
  1429. set(ZGEMM_UNROLL_N 4)
  1430. set(SYMV_P 16)
  1431. elseif ("${TCORE}" STREQUAL "RISCV64_ZVL128B")
  1432. file(APPEND ${TARGET_CONF_TEMP}
  1433. "#define L1_DATA_SIZE 32768\n"
  1434. "#define L1_DATA_LINESIZE 32\n"
  1435. "#define L2_SIZE 1048576\n"
  1436. "#define L2_LINESIZE 32 \n"
  1437. "#define DTB_DEFAULT_ENTRIES 128\n"
  1438. "#define DTB_SIZE 4096\n"
  1439. "#define L2_ASSOCIATIVE 4\n")
  1440. set(SGEMM_UNROLL_M 8)
  1441. set(SGEMM_UNROLL_N 8)
  1442. set(DGEMM_UNROLL_M 8)
  1443. set(DGEMM_UNROLL_N 4)
  1444. set(CGEMM_UNROLL_M 8)
  1445. set(CGEMM_UNROLL_N 4)
  1446. set(ZGEMM_UNROLL_M 4)
  1447. set(ZGEMM_UNROLL_N 4)
  1448. set(SYMV_P 16)
  1449. elseif ("${TCORE}" STREQUAL "RISCV64_ZVL256B")
  1450. file(APPEND ${TARGET_CONF_TEMP}
  1451. "#define L1_DATA_SIZE 65536\n"
  1452. "#define L1_DATA_LINESIZE 32\n"
  1453. "#define L2_SIZE 2097152\n"
  1454. "#define L2_LINESIZE 32 \n"
  1455. "#define DTB_DEFAULT_ENTRIES 128\n"
  1456. "#define DTB_SIZE 4096\n"
  1457. "#define L2_ASSOCIATIVE 4\n")
  1458. set(SGEMM_UNROLL_M 16)
  1459. set(SGEMM_UNROLL_N 8)
  1460. set(DGEMM_UNROLL_M 8)
  1461. set(DGEMM_UNROLL_N 8)
  1462. set(CGEMM_UNROLL_M 8)
  1463. set(CGEMM_UNROLL_N 8)
  1464. set(ZGEMM_UNROLL_M 8)
  1465. set(ZGEMM_UNROLL_N 4)
  1466. set(SYMV_P 16)
  1467. elseif ("${TCORE}" STREQUAL "GENERIC")
  1468. file(APPEND ${TARGET_CONF_TEMP}
  1469. "#define L1_DATA_SIZE 32768\n"
  1470. "#define L1_DATA_LINESIZE 128\n"
  1471. "#define L2_SIZE 524288\n"
  1472. "#define L2_LINESIZE 128 \n"
  1473. "#define DTB_DEFAULT_ENTRIES 128\n"
  1474. "#define DTB_SIZE 4096\n"
  1475. "#define L2_ASSOCIATIVE 8\n")
  1476. elseif ("${TCORE}" STREQUAL "RISCV64_GENERIC")
  1477. file(APPEND ${TARGET_CONF_TEMP}
  1478. "#define L1_DATA_SIZE 32768\n"
  1479. "#define L1_DATA_LINESIZE 32\n"
  1480. "#define L2_SIZE 1048576\n"
  1481. "#define L2_LINESIZE 32 \n"
  1482. "#define DTB_DEFAULT_ENTRIES 128\n"
  1483. "#define DTB_SIZE 4096\n"
  1484. "#define L2_ASSOCIATIVE 4\n")
  1485. elseif ("${TCORE}" STREQUAL "LA64_GENERIC")
  1486. file(APPEND ${TARGET_CONF_TEMP}
  1487. "#define DTB_DEFAULT_ENTRIES 64\n")
  1488. set(SGEMM_UNROLL_M 2)
  1489. set(SGEMM_UNROLL_N 8)
  1490. set(DGEMM_UNROLL_M 2)
  1491. set(DGEMM_UNROLL_N 8)
  1492. set(CGEMM_UNROLL_M 1)
  1493. set(CGEMM_UNROLL_N 4)
  1494. set(ZGEMM_UNROLL_M 1)
  1495. set(ZGEMM_UNROLL_N 4)
  1496. set(CGEMM3M_UNROLL_M 2)
  1497. set(CGEMM3M_UNROLL_N 8)
  1498. set(ZGEMM3M_UNROLL_M 2)
  1499. set(ZGEMM3M_UNROLL_N 8)
  1500. elseif ("${TCORE}" STREQUAL "LA264")
  1501. file(APPEND ${TARGET_CONF_TEMP}
  1502. "#define DTB_DEFAULT_ENTRIES 64\n")
  1503. set(HAVE_LSX 1)
  1504. set(SGEMM_UNROLL_M 2)
  1505. set(SGEMM_UNROLL_N 8)
  1506. set(DGEMM_UNROLL_M 8)
  1507. set(DGEMM_UNROLL_N 4)
  1508. set(CGEMM_UNROLL_M 8)
  1509. set(CGEMM_UNROLL_N 4)
  1510. set(ZGEMM_UNROLL_M 4)
  1511. set(ZGEMM_UNROLL_N 4)
  1512. set(CGEMM3M_UNROLL_M 2)
  1513. set(CGEMM3M_UNROLL_N 8)
  1514. set(ZGEMM3M_UNROLL_M 8)
  1515. set(ZGEMM3M_UNROLL_N 4)
  1516. elseif ("${TCORE}" STREQUAL "LA464")
  1517. file(APPEND ${TARGET_CONF_TEMP}
  1518. "#define DTB_DEFAULT_ENTRIES 64\n")
  1519. set(HAVE_LASX 1)
  1520. set(HAVE_LSX 1)
  1521. set(SGEMM_UNROLL_M 16)
  1522. set(SGEMM_UNROLL_N 8)
  1523. set(DGEMM_UNROLL_M 16)
  1524. set(DGEMM_UNROLL_N 6)
  1525. set(CGEMM_UNROLL_M 16)
  1526. set(CGEMM_UNROLL_N 4)
  1527. set(ZGEMM_UNROLL_M 8)
  1528. set(ZGEMM_UNROLL_N 4)
  1529. set(CGEMM3M_UNROLL_M 16)
  1530. set(CGEMM3M_UNROLL_N 8)
  1531. set(ZGEMM3M_UNROLL_M 16)
  1532. set(ZGEMM3M_UNROLL_N 6)
  1533. endif()
  1534. set(SBGEMM_UNROLL_M 8)
  1535. set(SBGEMM_UNROLL_N 4)
  1536. # Or should this actually be NUM_CORES?
  1537. if (${NUM_THREADS} GREATER 0)
  1538. file(APPEND ${TARGET_CONF_TEMP} "#define NUM_CORES\t${NUM_THREADS}\n")
  1539. endif()
  1540. # GetArch_2nd
  1541. foreach(float_char S;D;Q;C;Z;X)
  1542. if (NOT DEFINED ${float_char}GEMM_UNROLL_M)
  1543. message(STATUS "setting unrollm=2")
  1544. set(${float_char}GEMM_UNROLL_M 2)
  1545. endif()
  1546. if (NOT DEFINED ${float_char}GEMM_UNROLL_N)
  1547. message(STATUS "setting unrolln=2")
  1548. set(${float_char}GEMM_UNROLL_N 2)
  1549. endif()
  1550. endforeach()
  1551. file(APPEND ${TARGET_CONF_TEMP}
  1552. "#define GEMM_MULTITHREAD_THRESHOLD\t${GEMM_MULTITHREAD_THRESHOLD}\n")
  1553. # Move to where gen_config_h would place it
  1554. file(MAKE_DIRECTORY ${TARGET_CONF_DIR})
  1555. file(RENAME ${TARGET_CONF_TEMP} "${TARGET_CONF_DIR}/${TARGET_CONF}")
  1556. else(NOT CMAKE_CROSSCOMPILING)
  1557. # compile getarch
  1558. set(GETARCH_SRC
  1559. ${PROJECT_SOURCE_DIR}/getarch.c
  1560. ${CPUIDEMU}
  1561. )
  1562. if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
  1563. #Use generic for MSVC now
  1564. message(STATUS "MSVC")
  1565. set(GETARCH_FLAGS ${GETARCH_FLAGS} -DFORCE_GENERIC)
  1566. else()
  1567. if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
  1568. list(APPEND GETARCH_SRC ${PROJECT_SOURCE_DIR}/cpuid.S)
  1569. endif()
  1570. if (DEFINED TARGET_CORE)
  1571. set(GETARCH_FLAGS ${GETARCH_FLAGS} -DFORCE_${TARGET_CORE})
  1572. endif ()
  1573. endif ()
  1574. if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
  1575. # disable WindowsStore strict CRT checks
  1576. set(GETARCH_FLAGS ${GETARCH_FLAGS} -D_CRT_SECURE_NO_WARNINGS)
  1577. endif ()
  1578. set(GETARCH_DIR "${PROJECT_BINARY_DIR}/getarch_build")
  1579. set(GETARCH_BIN "getarch${CMAKE_EXECUTABLE_SUFFIX}")
  1580. file(MAKE_DIRECTORY "${GETARCH_DIR}")
  1581. configure_file("${TARGET_CONF_TEMP}" "${GETARCH_DIR}/${TARGET_CONF}" COPYONLY)
  1582. if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
  1583. if (CMAKE_ASM_COMPILER_ID STREQUAL "")
  1584. try_compile(GETARCH_RESULT "${GETARCH_DIR}"
  1585. SOURCES ${GETARCH_SRC}
  1586. CMAKE_FLAGS "-DCMAKE_ASM_COMPILER=${CMAKE_C_COMPILER}"
  1587. COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I"${GETARCH_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
  1588. OUTPUT_VARIABLE GETARCH_LOG
  1589. COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH_BIN}"
  1590. )
  1591. else()
  1592. try_compile(GETARCH_RESULT "${GETARCH_DIR}"
  1593. SOURCES ${GETARCH_SRC}
  1594. COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I"${GETARCH_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
  1595. OUTPUT_VARIABLE GETARCH_LOG
  1596. COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH_BIN}"
  1597. )
  1598. endif()
  1599. if (NOT ${GETARCH_RESULT})
  1600. MESSAGE(FATAL_ERROR "Compiling getarch failed ${GETARCH_LOG}")
  1601. endif ()
  1602. endif ()
  1603. unset (HAVE_AVX2)
  1604. unset (HAVE_AVX)
  1605. unset (HAVE_FMA3)
  1606. unset (HAVE_MMX)
  1607. unset (HAVE_SSE)
  1608. unset (HAVE_SSE2)
  1609. unset (HAVE_SSE3)
  1610. unset (HAVE_SSSE3)
  1611. unset (HAVE_SSE4A)
  1612. unset (HAVE_SSE4_1)
  1613. unset (HAVE_SSE4_2)
  1614. unset (HAVE_NEON)
  1615. unset (HAVE_VFP)
  1616. unset (HAVE_VFPV3)
  1617. unset (HAVE_VFPV4)
  1618. message(STATUS "Running getarch")
  1619. # use the cmake binary w/ the -E param to run a shell command in a cross-platform way
  1620. execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH_BIN}" 0 OUTPUT_VARIABLE GETARCH_MAKE_OUT)
  1621. execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH_BIN}" 1 OUTPUT_VARIABLE GETARCH_CONF_OUT)
  1622. message(STATUS "GETARCH results:\n${GETARCH_MAKE_OUT}")
  1623. # append config data from getarch to the TARGET file and read in CMake vars
  1624. file(APPEND "${TARGET_CONF_TEMP}" ${GETARCH_CONF_OUT})
  1625. ParseGetArchVars(${GETARCH_MAKE_OUT})
  1626. set(GETARCH2_DIR "${PROJECT_BINARY_DIR}/getarch2_build")
  1627. set(GETARCH2_BIN "getarch_2nd${CMAKE_EXECUTABLE_SUFFIX}")
  1628. file(MAKE_DIRECTORY "${GETARCH2_DIR}")
  1629. configure_file("${TARGET_CONF_TEMP}" "${GETARCH2_DIR}/${TARGET_CONF}" COPYONLY)
  1630. if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
  1631. try_compile(GETARCH2_RESULT "${GETARCH2_DIR}"
  1632. SOURCES "${PROJECT_SOURCE_DIR}/getarch_2nd.c"
  1633. COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} ${GETARCH2_FLAGS} -I"${GETARCH2_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
  1634. OUTPUT_VARIABLE GETARCH2_LOG
  1635. COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}"
  1636. )
  1637. if (NOT ${GETARCH2_RESULT})
  1638. MESSAGE(FATAL_ERROR "Compiling getarch_2nd failed ${GETARCH2_LOG}")
  1639. endif ()
  1640. endif ()
  1641. # use the cmake binary w/ the -E param to run a shell command in a cross-platform way
  1642. execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}" 0 OUTPUT_VARIABLE GETARCH2_MAKE_OUT)
  1643. execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}" 1 OUTPUT_VARIABLE GETARCH2_CONF_OUT)
  1644. # append config data from getarch_2nd to the TARGET file and read in CMake vars
  1645. file(APPEND "${TARGET_CONF_TEMP}" ${GETARCH2_CONF_OUT})
  1646. configure_file("${TARGET_CONF_TEMP}" "${TARGET_CONF_DIR}/${TARGET_CONF}" COPYONLY)
  1647. ParseGetArchVars(${GETARCH2_MAKE_OUT})
  1648. endif()