|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679 |
- ###############################################################################
- # Copyright (c) 2025, The OpenBLAS Project
- # All rights reserved.
- # 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.
- # 3. Neither the name of the OpenBLAS project nor the names of
- # its contributors may be used to endorse or promote products
- # derived from this software without specific prior written permission.
- # 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 OPENBLAS PROJECT 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: Hank Anderson <hank@statease.com>
- ## Description: Ported from OpenBLAS/Makefile.prebuild
- ## This is triggered by system.cmake and runs before any of the code is built.
- ## Creates config.h and Makefile.conf by first running the c_check perl script (which creates those files).
- ## Next it runs f_check and appends some fortran information to the files.
- ## Then it runs getarch and getarch_2nd for even more environment information.
- ## Finally it builds gen_config_h for use at build time to generate config.h.
-
- # CMake vars set by this file:
- # CORE
- # LIBCORE
- # NUM_CORES
- # HAVE_MMX
- # HAVE_SSE
- # HAVE_SSE2
- # HAVE_SSE3
- # MAKE
- # SBGEMM_UNROLL_M
- # SBGEMM_UNROLL_N
- # SGEMM_UNROLL_M
- # SGEMM_UNROLL_N
- # DGEMM_UNROLL_M
- # DGEMM_UNROLL_M
- # QGEMM_UNROLL_N
- # QGEMM_UNROLL_N
- # CGEMM_UNROLL_M
- # CGEMM_UNROLL_M
- # ZGEMM_UNROLL_N
- # ZGEMM_UNROLL_N
- # XGEMM_UNROLL_M
- # XGEMM_UNROLL_N
- # CGEMM3M_UNROLL_M
- # CGEMM3M_UNROLL_N
- # ZGEMM3M_UNROLL_M
- # ZGEMM3M_UNROLL_M
- # XGEMM3M_UNROLL_N
- # XGEMM3M_UNROLL_N
-
- # CPUIDEMU = ../../cpuid/table.o
-
-
- if (DEFINED CPUIDEMU)
- set(EXFLAGS "-DCPUIDEMU -DVENDOR=99")
- endif ()
-
- if (BUILD_KERNEL)
- # set the C flags for just this file
- set(GETARCH2_FLAGS "-DBUILD_KERNEL")
- set(TARGET_CONF "config_kernel.h")
- set(TARGET_CONF_DIR ${PROJECT_BINARY_DIR}/kernel_config/${TARGET_CORE})
- else()
- set(TARGET_CONF "config.h")
- set(TARGET_CONF_DIR ${PROJECT_BINARY_DIR})
- endif ()
-
- set(TARGET_CONF_TEMP "${PROJECT_BINARY_DIR}/${TARGET_CONF}.tmp")
-
- # c_check
- set(FU "")
- if (APPLE OR (MSVC AND NOT (${CMAKE_C_COMPILER_ID} MATCHES "Clang" OR ${CMAKE_C_COMPILER_ID} MATCHES "IntelLLVM")))
- set(FU "_")
- endif()
- if(MINGW AND NOT MINGW64)
- set(FU "_")
- endif()
-
- set(COMPILER_ID ${CMAKE_C_COMPILER_ID})
- if (${COMPILER_ID} STREQUAL "GNU")
- set(COMPILER_ID "GCC")
- endif ()
-
- string(TOUPPER ${ARCH} UC_ARCH)
-
- file(WRITE ${TARGET_CONF_TEMP}
- "#define OS_${HOST_OS}\t1\n"
- "#define ARCH_${UC_ARCH}\t1\n"
- "#define C_${COMPILER_ID}\t1\n"
- "#define __${BINARY}BIT__\t1\n"
- "#define FUNDERSCORE\t${FU}\n")
-
- if (${HOST_OS} STREQUAL "WINDOWSSTORE")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define OS_WINNT\t1\n")
- endif ()
-
- # f_check
- if (NOT NOFORTRAN)
- include("${PROJECT_SOURCE_DIR}/cmake/f_check.cmake")
- else ()
- file(APPEND ${TARGET_CONF_TEMP}
- "#define BUNDERSCORE _\n"
- "#define NEEDBUNDERSCORE 1\n")
- set(BU "_")
- endif ()
-
- # Cannot run getarch on target if we are cross-compiling
- if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSSTORE"))
- # Write to config as getarch would
- if (DEFINED TARGET_CORE)
- set(TCORE ${TARGET_CORE})
- else()
- set(TCORE ${CORE})
- endif()
-
- # TODO: Set up defines that getarch sets up based on every other target
- # Perhaps this should be inside a different file as it grows larger
- file(APPEND ${TARGET_CONF_TEMP}
- "#define ${TCORE}\n"
- "#define CORE_${TCORE}\n"
- "#define CHAR_CORENAME \"${TCORE}\"\n")
- if ("${TCORE}" STREQUAL "CORE2")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t1048576\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t256\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define SLOCAL_BUFFER_SIZE\t16384\n"
- "#define DLOCAL_BUFFER_SIZE\t16384\n"
- "#define CLOCAL_BUFFER_SIZE\t16384\n"
- "#define ZLOCAL_BUFFER_SIZE\t16384\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(BGEMM_UNROLL_M 8)
- set(BGEMM_UNROLL_N 4)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "ATOM")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t24576\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t524288\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define SLOCAL_BUFFER_SIZE\t16384\n"
- "#define DLOCAL_BUFFER_SIZE\t8192\n"
- "#define CLOCAL_BUFFER_SIZE\t16384\n"
- "#define ZLOCAL_BUFFER_SIZE\t8192\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 1)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "PRESCOTT")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t16384\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t1048576\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define SLOCAL_BUFFER_SIZE\t8192\n"
- "#define DLOCAL_BUFFER_SIZE\t8192\n"
- "#define CLOCAL_BUFFER_SIZE\t8192\n"
- "#define ZLOCAL_BUFFER_SIZE\t8192\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "NEHALEM")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define SLOCAL_BUFFER_SIZE\t65535\n"
- "#define DLOCAL_BUFFER_SIZE\t32768\n"
- "#define CLOCAL_BUFFER_SIZE\t65536\n"
- "#define ZLOCAL_BUFFER_SIZE\t32768\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 4)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 2)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 1)
- set(ZGEMM_UNROLL_N 4)
- set(CGEMM3M_UNROLL_M 4)
- set(CGEMM3M_UNROLL_N 8)
- set(ZGEMM3M_UNROLL_M 2)
- set(ZGEMM3M_UNROLL_N 8)
- elseif ("${TCORE}" STREQUAL "SANDYBRIDGE")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_AVX\n"
- "#define SLOCAL_BUFFER_SIZE\t24576\n"
- "#define DLOCAL_BUFFER_SIZE\t16384\n"
- "#define CLOCAL_BUFFER_SIZE\t32768\n"
- "#define ZLOCAL_BUFFER_SIZE\t24576\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_AVX 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 1)
- set(ZGEMM_UNROLL_N 4)
- set(CGEMM3M_UNROLL_M 4)
- set(CGEMM3M_UNROLL_N 8)
- set(ZGEMM3M_UNROLL_M 2)
- set(ZGEMM3M_UNROLL_N 8)
- elseif ("${TCORE}" STREQUAL "HASWELL")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_AVX\n"
- "#define HAVE_AVX2\n"
- "#define HAVE_FMA3\n"
- "#define SLOCAL_BUFFER_SIZE\t20480\n"
- "#define DLOCAL_BUFFER_SIZE\t32768\n"
- "#define CLOCAL_BUFFER_SIZE\t16384\n"
- "#define ZLOCAL_BUFFER_SIZE\t12288\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_AVX 1)
- set(HAVE_AVX2 1)
- set(HAVE_FMA3 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "SKYLAKEX")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_AVX\n"
- "#define HAVE_AVX2\n"
- "#define HAVE_FMA3\n"
- "#define HAVE_AVX512VL\n"
- "#define SLOCAL_BUFFER_SIZE\t28672\n"
- "#define DLOCAL_BUFFER_SIZE\t12288\n"
- "#define CLOCAL_BUFFER_SIZE\t12288\n"
- "#define ZLOCAL_BUFFER_SIZE\t8192\n")
- set(HAVE_CMOV 1)
- set(HAVE_MMX 1)
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_AVX 1)
- set(HAVE_AVX2 1)
- set(HAVE_FMA3 1)
- set(HAVE_AVX512VL 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 16)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "COOPERLAKE")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_AVX\n"
- "#define HAVE_AVX2\n"
- "#define HAVE_FMA3\n"
- "#define HAVE_AVX512VL\n"
- "#define HAVE_AVX512BF16\n"
- "#define SLOCAL_BUFFER_SIZE\t20480\n"
- "#define DLOCAL_BUFFER_SIZE\t12288\n"
- "#define CLOCAL_BUFFER_SIZE\t12288\n"
- "#define ZLOCAL_BUFFER_SIZE\t8192\n")
- set(HAVE_CMOV 1)
- set(HAVE_MMX 1)
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_AVX 1)
- set(HAVE_AVX2 1)
- set(HAVE_FMA3 1)
- set(HAVE_AVX512VL 1)
- set(HAVE_AVX512BF16 1)
- set(SBGEMM_UNROLL_M 16)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 16)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "SAPPHIRERAPIDS")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_CMOV\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_AVX\n"
- "#define HAVE_AVX2\n"
- "#define HAVE_FMA3\n"
- "#define HAVE_AVX512VL\n"
- "#define HAVE_AVX512BF16\n"
- "#define SLOCAL_BUFFER_SIZE\t20480\n"
- "#define DLOCAL_BUFFER_SIZE\t12288\n"
- "#define CLOCAL_BUFFER_SIZE\t12288\n"
- "#define ZLOCAL_BUFFER_SIZE\t8192\n")
- set(HAVE_CMOV 1)
- set(HAVE_MMX 1)
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_AVX 1)
- set(HAVE_AVX2 1)
- set(HAVE_FMA3 1)
- set(HAVE_AVX512VL 1)
- set(HAVE_AVX512BF16 1)
- set(SBGEMM_UNROLL_M 32)
- set(SBGEMM_UNROLL_N 16)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 16)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "OPTERON")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t1048576\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t32\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_3DNOW\n"
- "#define HAVE_3DNOWEX\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define SLOCAL_BUFFER_SIZE\t15360\n"
- "#define DLOCAL_BUFFER_SIZE\t15360\n"
- "#define CLOCAL_BUFFER_SIZE\t15360\n"
- "#define ZLOCAL_BUFFER_SIZE\t15360\n")
- set(HAVE_3DNOW 1)
- set(HAVE_3DNOWEX 1)
- set(HAVE_MMX 1)
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "BARCELONA")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t524288\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSE4A\n"
- "#define HAVE_MISALIGNSSE\n"
- "#define HAVE_128BITFPU\n"
- "#define HAVE_FASTMOVU\n"
- "#define SLOCAL_BUFFER_SIZE\t14336\n"
- "#define DLOCAL_BUFFER_SIZE\t14336\n"
- "#define CLOCAL_BUFFER_SIZE\t14336\n"
- "#define ZLOCAL_BUFFER_SIZE\t14336\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSE4A 1)
- set(HAVE_MISALIGNSSE 1)
- set(HAVE_128BITFPU 1)
- set(HAVE_FASTMOVU 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "BULLDOZER")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t49152\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t1024000\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t32\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSE4A\n"
- "#define HAVE_AVX\n"
- "#define HAVE_MISALIGNSSE\n"
- "#define HAVE_128BITFPU\n"
- "#define HAVE_FASTMOVU\n"
- "#define SLOCAL_BUFFER_SIZE\t5376\n"
- "#define DLOCAL_BUFFER_SIZE\t5376\n"
- "#define CLOCAL_BUFFER_SIZE\t14336\n"
- "#define ZLOCAL_BUFFER_SIZE\t14336\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSE4A 1)
- set(HAVE_AVX 1)
- set(HAVE_MISALIGNSSE 1)
- set(HAVE_128BITFPU 1)
- set(HAVE_FASTMOVU 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "PILEDRIVER")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t16384\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t2097152\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_SSE4A\n"
- "#define HAVE_AVX\n"
- "#define HAVE_MISALIGNSSE\n"
- "#define HAVE_128BITFPU\n"
- "#define HAVE_FASTMOVU\n"
- "#define HAVE_CFLUSH\n"
- "#define HAVE_FMA3\n"
- "#define SLOCAL_BUFFER_SIZE\t6144\n"
- "#define DLOCAL_BUFFER_SIZE\t5376\n"
- "#define CLOCAL_BUFFER_SIZE\t10752\n"
- "#define ZLOCAL_BUFFER_SIZE\t10752\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_SSE4A 1)
- set(HAVE_AVX 1)
- set(HAVE_FMA3 1)
- set(HAVE_MISALIGNSSE 1)
- set(HAVE_128BITFPU 1)
- set(HAVE_FASTMOVU 1)
- set(HAVE_CFLUSH 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "STEAMROLLER")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t16384\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t2097152\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_SSE4A\n"
- "#define HAVE_AVX\n"
- "#define HAVE_MISALIGNSSE\n"
- "#define HAVE_128BITFPU\n"
- "#define HAVE_FASTMOVU\n"
- "#define HAVE_CFLUSH\n"
- "#define HAVE_FMA3\n"
- "#define SLOCAL_BUFFER_SIZE\t6144\n"
- "#define DLOCAL_BUFFER_SIZE\t5120\n"
- "#define CLOCAL_BUFFER_SIZE\t10240\n"
- "#define ZLOCAL_BUFFER_SIZE\t10240\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_SSE4A 1)
- set(HAVE_AVX 1)
- set(HAVE_FMA3 1)
- set(HAVE_MISALIGNSSE 1)
- set(HAVE_128BITFPU 1)
- set(HAVE_FASTMOVU 1)
- set(HAVE_CFLUSH 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "EXCAVATOR")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t16384\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t2097152\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_SSE4A\n"
- "#define HAVE_AVX\n"
- "#define HAVE_MISALIGNSSE\n"
- "#define HAVE_128BITFPU\n"
- "#define HAVE_FASTMOVU\n"
- "#define HAVE_CFLUSH\n"
- "#define HAVE_FMA3\n"
- "#define SLOCAL_BUFFER_SIZE\t6144\n"
- "#define DLOCAL_BUFFER_SIZE\t5120\n"
- "#define CLOCAL_BUFFER_SIZE\t10240\n"
- "#define ZLOCAL_BUFFER_SIZE\t10240\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_SSE4A 1)
- set(HAVE_AVX 1)
- set(HAVE_FMA3 1)
- set(HAVE_MISALIGNSSE 1)
- set(HAVE_128BITFPU 1)
- set(HAVE_FASTMOVU 1)
- set(HAVE_CFLUSH 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 4)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "ZEN")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t524288\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_MMX\n"
- "#define HAVE_SSE\n"
- "#define HAVE_SSE2\n"
- "#define HAVE_SSE3\n"
- "#define HAVE_SSE4_1\n"
- "#define HAVE_SSE4_2\n"
- "#define HAVE_SSE4A\n"
- "#define HAVE_MISALIGNSSE\n"
- "#define HAVE_128BITFPU\n"
- "#define HAVE_FASTMOVU\n"
- "#define HAVE_CFLUSH\n"
- "#define HAVE_AVX\n"
- "#define HAVE_AVX2\n"
- "#define HAVE_FMA3\n"
- "#define SLOCAL_BUFFER_SIZE\t20480\n"
- "#define DLOCAL_BUFFER_SIZE\t32768\n"
- "#define CLOCAL_BUFFER_SIZE\t16384\n"
- "#define ZLOCAL_BUFFER_SIZE\t12288\n")
- set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
- set(HAVE_SSE3 1)
- set(HAVE_SSE4_1 1)
- set(HAVE_SSE4_2 1)
- set(HAVE_AVX 1)
- set(HAVE_AVX2 1)
- set(HAVE_FMA3 1)
- set(HAVE_SSE4A 1)
- set(HAVE_MISALIGNSSE 1)
- set(HAVE_128BITFPU 1)
- set(HAVE_FASTMOVU 1)
- set(HAVE_CFLUSH 1)
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 2)
- set(CGEMM3M_UNROLL_M 8)
- set(CGEMM3M_UNROLL_N 4)
- set(ZGEMM3M_UNROLL_M 4)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "ARMV5")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t32\n"
- "#define L2_SIZE\t512488\n"
- "#define L2_LINESIZE\t32\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define L2_ASSOCIATIVE\t4\n")
- set(SGEMM_UNROLL_M 2)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 2)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- elseif ("${TCORE}" STREQUAL "ARMV6")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t32\n"
- "#define L2_SIZE\t512488\n"
- "#define L2_LINESIZE\t32\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define L2_ASSOCIATIVE\t4\n"
- "#define HAVE_VFP\n")
- set(SGEMM_UNROLL_M 4)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- elseif ("${TCORE}" STREQUAL "ARMV7")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t32\n"
- "#define L2_SIZE\t512488\n"
- "#define L2_LINESIZE\t32\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define L2_ASSOCIATIVE\t4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n")
- set(SGEMM_UNROLL_M 4)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- elseif ("${TCORE}" STREQUAL "ARMV8")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define L2_ASSOCIATIVE\t32\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "CORTEXA57" OR "${TCORE}" STREQUAL "CORTEXA53" OR "${TCORE}" STREQUAL "CORTEXA55")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t32768\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t3\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t2\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t16\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define ARMV8\n")
- if ("${TCORE}" STREQUAL "CORTEXA57")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- else ()
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 8)
- endif ()
- if ("${TCORE}" STREQUAL "CORTEXA53")
- set(DGEMM_UNROLL_M 4)
- else ()
- set(DGEMM_UNROLL_M 8)
- endif ()
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "CORTEXA72" OR "${TCORE}" STREQUAL "CORTEXA73" OR "${TCORE}" STREQUAL "CORTEXA76")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t49152\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t3\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t2\n"
- "#define L2_SIZE\t524288\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t16\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "NEOVERSEN1")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t65536\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t4\n"
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t4\n"
- "#define L2_SIZE\t1048576\n\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define DTB_DEFAULT_ENTRIES\t48\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "NEOVERSEV1")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t65536\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t4\n"
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t4\n"
- "#define L2_SIZE\t1048576\n\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define DTB_DEFAULT_ENTRIES\t48\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define HAVE_SVE\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "NEOVERSEN2" OR "${TCORE}" STREQUAL "ARMV9SME")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t65536\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t4\n"
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t2\n"
- "#define L2_SIZE\t1048576\n\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define DTB_DEFAULT_ENTRIES\t48\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define HAVE_SVE\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "FALKOR")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t65536\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t3\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t128\n"
- "#define L1_DATA_ASSOCIATIVE\t2\n"
- "#define L2_SIZE\t524288\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t16\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "THUNDERX")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t32768\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t3\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t128\n"
- "#define L1_DATA_ASSOCIATIVE\t2\n"
- "#define L2_SIZE\t167772164\n"
- "#define L2_LINESIZE\t128\n"
- "#define L2_ASSOCIATIVE\t16\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 4)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 2)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "THUNDERX2T99")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t32768\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t8\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t8\n"
- "#define L2_SIZE\t262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define L3_SIZE\t33554432\n"
- "#define L3_LINESIZE\t64\n"
- "#define L3_ASSOCIATIVE\t32\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "THUNDERX3T110")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define THUNDERX3T110\n"
- "#define L1_CODE_SIZE\t65536\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t8\n"
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t8\n"
- "#define L2_SIZE\t524288\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define L3_SIZE\t94371840\n"
- "#define L3_LINESIZE\t64\n"
- "#define L3_ASSOCIATIVE\t32\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "TSV110")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define ARMV8\n"
- "#define L1_CODE_SIZE\t65536\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t4\n"
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t4\n"
- "#define L2_SIZE\t524288\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "EMAG8180")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define ARMV8\n"
- "#define L1_CODE_SIZE\t32768\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t4\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t4\n"
- "#define L2_SIZE\t5262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "AMPEREONE")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t16384\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t4\n"
- "#define L1_DATA_SIZE\t65536\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t4\n"
- "#define L2_SIZE\t2097152\n\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "VORTEX")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define ARMV8\n"
- "#define L1_CODE_SIZE\t32768\n"
- "#define L1_CODE_LINESIZE\t64\n"
- "#define L1_CODE_ASSOCIATIVE\t4\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L1_DATA_ASSOCIATIVE\t4\n"
- "#define L2_SIZE\t5262144\n"
- "#define L2_LINESIZE\t64\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "A64FX")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_CODE_SIZE\t65536\n"
- "#define L1_CODE_LINESIZE\t256\n"
- "#define L1_CODE_ASSOCIATIVE\t8\n"
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t256\n"
- "#define L1_DATA_ASSOCIATIVE\t8\n"
- "#define L2_SIZE\t8388608\n\n"
- "#define L2_LINESIZE\t256\n"
- "#define L2_ASSOCIATIVE\t8\n"
- "#define L3_SIZE\t0\n\n"
- "#define L3_LINESIZE\t0\n\n"
- "#define L3_ASSOCIATIVE\t0\n\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define HAVE_VFPV4\n"
- "#define HAVE_VFPV3\n"
- "#define HAVE_VFP\n"
- "#define HAVE_NEON\n"
- "#define HAVE_SVE\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 4)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 2)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "ARMV8SVE" OR "${TCORE}" STREQUAL "CORTEXA510" OR "${TCORE}" STREQUAL "CORTEXX2" OR "${TCORE}" STREQUAL "ARMV9")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE\t32768\n"
- "#define L1_DATA_LINESIZE\t64\n"
- "#define L2_SIZE\t1048576\n"
- "#define L2_LINESIZE\t64\n"
- "#define DTB_DEFAULT_ENTRIES\t64\n"
- "#define DTB_SIZE\t4096\n"
- "#define L2_ASSOCIATIVE\t32\n"
- "#define ARMV8\n")
- set(SGEMM_UNROLL_M 4)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "P5600")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L2_SIZE 1048576\n"
- "#define DTB_SIZE 4096\n"
- "#define DTB_DEFAULT_ENTRIES 64\n")
- set(SGEMM_UNROLL_M 2)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 2)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(SYMV_P 16)
- elseif ("${TCORE}" MATCHES "MIPS")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L2_SIZE 262144\n"
- "#define DTB_SIZE 4096\n"
- "#define DTB_DEFAULT_ENTRIES 64\n")
- set(SGEMM_UNROLL_M 2)
- set(SGEMM_UNROLL_N 2)
- set(DGEMM_UNROLL_M 2)
- set(DGEMM_UNROLL_N 2)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "POWER6")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 32768\n"
- "#define L1_DATA_LINESIZE 128\n"
- "#define L2_SIZE 524288\n"
- "#define L2_LINESIZE 128 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 8\n")
- set(SGEMM_UNROLL_M 4)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 4)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 8)
- elseif ("${TCORE}" STREQUAL "POWER8")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 32768\n"
- "#define L1_DATA_LINESIZE 128\n"
- "#define L2_SIZE 524288\n"
- "#define L2_LINESIZE 128 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 16)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 8)
- set(ZGEMM_UNROLL_N 2)
- set(SYMV_P 8)
- elseif ("${TCORE}" STREQUAL "POWER9" OR "${TCORE}" STREQUAL "POWER10")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 32768\n"
- "#define L1_DATA_LINESIZE 128\n"
- "#define L2_SIZE 524288\n"
- "#define L2_LINESIZE 128 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 8\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 16)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 8)
- set(ZGEMM_UNROLL_N 2)
- set(SYMV_P 8)
- elseif ("${TCORE}" STREQUAL "C910V")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 32768\n"
- "#define L1_DATA_LINESIZE 32\n"
- "#define L2_SIZE 1048576\n"
- "#define L2_LINESIZE 32 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 4\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 4)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 2)
- set(CGEMM_UNROLL_N 2)
- set(ZGEMM_UNROLL_M 2)
- set(ZGEMM_UNROLL_N 2)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "x280")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 65536\n"
- "#define L1_LINESIZE 32 \n"
- "#define L2_SIZE 2097152\n"
- "#define L2_LINESIZE 32 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 4\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 16)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 8)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "RISCV64_ZVL128B")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 32768\n"
- "#define L1_DATA_LINESIZE 32\n"
- "#define L2_SIZE 1048576\n"
- "#define L2_LINESIZE 32 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 4\n")
- set(SGEMM_UNROLL_M 8)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "RISCV64_ZVL256B")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 65536\n"
- "#define L1_DATA_LINESIZE 32\n"
- "#define L2_SIZE 2097152\n"
- "#define L2_LINESIZE 32 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 4\n")
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 8)
- set(ZGEMM_UNROLL_M 8)
- set(ZGEMM_UNROLL_N 4)
- set(SYMV_P 16)
- elseif ("${TCORE}" STREQUAL "GENERIC")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 32768\n"
- "#define L1_DATA_LINESIZE 128\n"
- "#define L2_SIZE 524288\n"
- "#define L2_LINESIZE 128 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 8\n")
- elseif ("${TCORE}" STREQUAL "RISCV64_GENERIC")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define L1_DATA_SIZE 32768\n"
- "#define L1_DATA_LINESIZE 32\n"
- "#define L2_SIZE 1048576\n"
- "#define L2_LINESIZE 32 \n"
- "#define DTB_DEFAULT_ENTRIES 128\n"
- "#define DTB_SIZE 4096\n"
- "#define L2_ASSOCIATIVE 4\n")
- elseif ("${TCORE}" STREQUAL "LA64_GENERIC")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define DTB_DEFAULT_ENTRIES 64\n")
- set(SGEMM_UNROLL_M 2)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 2)
- set(DGEMM_UNROLL_N 8)
- set(CGEMM_UNROLL_M 1)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 1)
- set(ZGEMM_UNROLL_N 4)
- set(CGEMM3M_UNROLL_M 2)
- set(CGEMM3M_UNROLL_N 8)
- set(ZGEMM3M_UNROLL_M 2)
- set(ZGEMM3M_UNROLL_N 8)
- elseif ("${TCORE}" STREQUAL "LA264")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define DTB_DEFAULT_ENTRIES 64\n")
- set(HAVE_LSX 1)
- set(SGEMM_UNROLL_M 2)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 8)
- set(DGEMM_UNROLL_N 4)
- set(CGEMM_UNROLL_M 8)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 4)
- set(ZGEMM_UNROLL_N 4)
- set(CGEMM3M_UNROLL_M 2)
- set(CGEMM3M_UNROLL_N 8)
- set(ZGEMM3M_UNROLL_M 8)
- set(ZGEMM3M_UNROLL_N 4)
- elseif ("${TCORE}" STREQUAL "LA464")
- file(APPEND ${TARGET_CONF_TEMP}
- "#define DTB_DEFAULT_ENTRIES 64\n")
- set(HAVE_LASX 1)
- set(HAVE_LSX 1)
- set(SGEMM_UNROLL_M 16)
- set(SGEMM_UNROLL_N 8)
- set(DGEMM_UNROLL_M 16)
- set(DGEMM_UNROLL_N 6)
- set(CGEMM_UNROLL_M 16)
- set(CGEMM_UNROLL_N 4)
- set(ZGEMM_UNROLL_M 8)
- set(ZGEMM_UNROLL_N 4)
- set(CGEMM3M_UNROLL_M 16)
- set(CGEMM3M_UNROLL_N 8)
- set(ZGEMM3M_UNROLL_M 16)
- set(ZGEMM3M_UNROLL_N 6)
- endif()
- set(SBGEMM_UNROLL_M 8)
- set(SBGEMM_UNROLL_N 4)
-
- # Or should this actually be NUM_CORES?
- if (${NUM_THREADS} GREATER 0)
- file(APPEND ${TARGET_CONF_TEMP} "#define NUM_CORES\t${NUM_THREADS}\n")
- endif()
-
- # GetArch_2nd
- foreach(float_char S;D;Q;C;Z;X)
- if (NOT DEFINED ${float_char}GEMM_UNROLL_M)
- message(STATUS "setting unrollm=2")
- set(${float_char}GEMM_UNROLL_M 2)
- endif()
- if (NOT DEFINED ${float_char}GEMM_UNROLL_N)
- message(STATUS "setting unrolln=2")
- set(${float_char}GEMM_UNROLL_N 2)
- endif()
- endforeach()
- file(APPEND ${TARGET_CONF_TEMP}
- "#define GEMM_MULTITHREAD_THRESHOLD\t${GEMM_MULTITHREAD_THRESHOLD}\n")
- # Move to where gen_config_h would place it
- file(MAKE_DIRECTORY ${TARGET_CONF_DIR})
- file(RENAME ${TARGET_CONF_TEMP} "${TARGET_CONF_DIR}/${TARGET_CONF}")
-
- else(NOT CMAKE_CROSSCOMPILING)
- # compile getarch
- set(GETARCH_SRC
- ${PROJECT_SOURCE_DIR}/getarch.c
- ${CPUIDEMU}
- )
-
- if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
- #Use generic for MSVC now
- message(STATUS "MSVC")
- set(GETARCH_FLAGS ${GETARCH_FLAGS} -DFORCE_GENERIC)
- else()
- if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- list(APPEND GETARCH_SRC ${PROJECT_SOURCE_DIR}/cpuid.S)
- endif()
- if (DEFINED TARGET_CORE)
- set(GETARCH_FLAGS ${GETARCH_FLAGS} -DFORCE_${TARGET_CORE})
- endif ()
- endif ()
-
- if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
- # disable WindowsStore strict CRT checks
- set(GETARCH_FLAGS ${GETARCH_FLAGS} -D_CRT_SECURE_NO_WARNINGS)
- endif ()
-
- set(GETARCH_DIR "${PROJECT_BINARY_DIR}/getarch_build")
- set(GETARCH_BIN "getarch${CMAKE_EXECUTABLE_SUFFIX}")
- file(MAKE_DIRECTORY "${GETARCH_DIR}")
- configure_file("${TARGET_CONF_TEMP}" "${GETARCH_DIR}/${TARGET_CONF}" COPYONLY)
- if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
- if (CMAKE_ASM_COMPILER_ID STREQUAL "")
- try_compile(GETARCH_RESULT "${GETARCH_DIR}"
- SOURCES ${GETARCH_SRC}
- CMAKE_FLAGS "-DCMAKE_ASM_COMPILER=${CMAKE_C_COMPILER}"
- COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I"${GETARCH_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
- OUTPUT_VARIABLE GETARCH_LOG
- COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH_BIN}"
- )
- else()
- try_compile(GETARCH_RESULT "${GETARCH_DIR}"
- SOURCES ${GETARCH_SRC}
- COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I"${GETARCH_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
- OUTPUT_VARIABLE GETARCH_LOG
- COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH_BIN}"
- )
- endif()
- if (NOT ${GETARCH_RESULT})
- MESSAGE(FATAL_ERROR "Compiling getarch failed ${GETARCH_LOG}")
- endif ()
- endif ()
- unset (HAVE_AVX2)
- unset (HAVE_AVX)
- unset (HAVE_FMA3)
- unset (HAVE_MMX)
- unset (HAVE_SSE)
- unset (HAVE_SSE2)
- unset (HAVE_SSE3)
- unset (HAVE_SSSE3)
- unset (HAVE_SSE4A)
- unset (HAVE_SSE4_1)
- unset (HAVE_SSE4_2)
- unset (HAVE_NEON)
- unset (HAVE_VFP)
- unset (HAVE_VFPV3)
- unset (HAVE_VFPV4)
- message(STATUS "Running getarch")
-
- # use the cmake binary w/ the -E param to run a shell command in a cross-platform way
- execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH_BIN}" 0 OUTPUT_VARIABLE GETARCH_MAKE_OUT)
- execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH_BIN}" 1 OUTPUT_VARIABLE GETARCH_CONF_OUT)
-
- message(STATUS "GETARCH results:\n${GETARCH_MAKE_OUT}")
-
- # append config data from getarch to the TARGET file and read in CMake vars
- file(APPEND "${TARGET_CONF_TEMP}" ${GETARCH_CONF_OUT})
- ParseGetArchVars(${GETARCH_MAKE_OUT})
-
- set(GETARCH2_DIR "${PROJECT_BINARY_DIR}/getarch2_build")
- set(GETARCH2_BIN "getarch_2nd${CMAKE_EXECUTABLE_SUFFIX}")
- file(MAKE_DIRECTORY "${GETARCH2_DIR}")
- configure_file("${TARGET_CONF_TEMP}" "${GETARCH2_DIR}/${TARGET_CONF}" COPYONLY)
- if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
- try_compile(GETARCH2_RESULT "${GETARCH2_DIR}"
- SOURCES "${PROJECT_SOURCE_DIR}/getarch_2nd.c"
- COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} ${GETARCH2_FLAGS} -I"${GETARCH2_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
- OUTPUT_VARIABLE GETARCH2_LOG
- COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}"
- )
-
- if (NOT ${GETARCH2_RESULT})
- MESSAGE(FATAL_ERROR "Compiling getarch_2nd failed ${GETARCH2_LOG}")
- endif ()
- endif ()
-
- # use the cmake binary w/ the -E param to run a shell command in a cross-platform way
- execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}" 0 OUTPUT_VARIABLE GETARCH2_MAKE_OUT)
- execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}" 1 OUTPUT_VARIABLE GETARCH2_CONF_OUT)
-
- # append config data from getarch_2nd to the TARGET file and read in CMake vars
- file(APPEND "${TARGET_CONF_TEMP}" ${GETARCH2_CONF_OUT})
-
- configure_file("${TARGET_CONF_TEMP}" "${TARGET_CONF_DIR}/${TARGET_CONF}" COPYONLY)
-
- ParseGetArchVars(${GETARCH2_MAKE_OUT})
-
- endif()
|