diff options
author | samvel <samvel@yandex-team.ru> | 2022-02-10 16:51:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:51:40 +0300 |
commit | 368058fa36ac29dde5ef05db66072c998a47fb58 (patch) | |
tree | ab7fbbf3253d4c0e2793218f09378908beb025fb | |
parent | 94750cc5802a241ad847ee112a12323934f36750 (diff) | |
download | ydb-368058fa36ac29dde5ef05db66072c998a47fb58.tar.gz |
Restoring authorship annotation for <samvel@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | build/plugins/build_mn_files.py | 46 | ||||
-rwxr-xr-x | build/scripts/build_mn.py | 66 | ||||
-rw-r--r-- | build/ymake.core.conf | 4 |
3 files changed, 58 insertions, 58 deletions
diff --git a/build/plugins/build_mn_files.py b/build/plugins/build_mn_files.py index e5681fac4c..4da76f1852 100644 --- a/build/plugins/build_mn_files.py +++ b/build/plugins/build_mn_files.py @@ -1,29 +1,29 @@ -from os.path import basename, splitext - +from os.path import basename, splitext + def on_build_mns_files(unit, *args): - files = [] - name = '' - ranking_suffix = '' - check = '' - index = 0 + files = [] + name = '' + ranking_suffix = '' + check = '' + index = 0 fml_unused_tool = '' - while index < len(args): - if args[index] == 'NAME': - index += 1 - name = args[index] - elif args[index] == 'RANKING_SUFFIX': - index += 1 - ranking_suffix = args[index] - elif args[index] == 'CHECK': - check = 'CHECK' + while index < len(args): + if args[index] == 'NAME': + index += 1 + name = args[index] + elif args[index] == 'RANKING_SUFFIX': + index += 1 + ranking_suffix = args[index] + elif args[index] == 'CHECK': + check = 'CHECK' fml_unused_tool = unit.get('FML_UNUSED_TOOL') or '$FML_UNUSED_TOOL' - else: - files.append(args[index]) - index += 1 - - for filename in files: - file_basename, _ = splitext(basename(filename)) + else: + files.append(args[index]) + index += 1 + + for filename in files: + file_basename, _ = splitext(basename(filename)) asmdataname = "staticMn{0}{1}Ptr".format(ranking_suffix, file_basename) - output_name = 'mn.staticMn{0}{1}Ptr.cpp'.format(ranking_suffix, file_basename) + output_name = 'mn.staticMn{0}{1}Ptr.cpp'.format(ranking_suffix, file_basename) unit.on_build_mns_file([filename, name, output_name, ranking_suffix, check, fml_unused_tool, asmdataname]) diff --git a/build/scripts/build_mn.py b/build/scripts/build_mn.py index b1789255a3..5bb03c247c 100755 --- a/build/scripts/build_mn.py +++ b/build/scripts/build_mn.py @@ -7,19 +7,19 @@ import shutil import re import subprocess - -def get_value(val): - dct = val.split('=', 1) - if len(dct) > 1: - return dct[1] - return '' - - + +def get_value(val): + dct = val.split('=', 1) + if len(dct) > 1: + return dct[1] + return '' + + class BuildMnBase(object): def Run(self, mninfo, mnname, mnrankingSuffix, mncppPath, check=False, ptr=False, multi=False): self.mninfo = mninfo self.mnname = mnname - self.mnrankingSuffix = mnrankingSuffix + self.mnrankingSuffix = mnrankingSuffix self.mncppPath = mncppPath self.check = check self.ptr = ptr @@ -108,15 +108,15 @@ class BuildMn(BuildMnBase): class BuildMns(BuildMnBase): - def InitBase(self, listname, mnrankingSuffix): + def InitBase(self, listname, mnrankingSuffix): self.autogen = '// DO NOT EDIT THIS FILE DIRECTLY, AUTOGENERATED!\n' - self.mnrankingSuffix = mnrankingSuffix - self.mnlistname = listname + mnrankingSuffix + self.mnrankingSuffix = mnrankingSuffix + self.mnlistname = listname + mnrankingSuffix self.mnlistelem = "const NMatrixnet::TMnSsePtr*" mnlisttype = "TMap< TString, {0} >".format(self.mnlistelem) self.mnlist = "const {0} {1}".format(mnlisttype, self.mnlistname) - self.mnmultilistname = "{0}{1}Multi".format(listname, self.mnrankingSuffix) + self.mnmultilistname = "{0}{1}Multi".format(listname, self.mnrankingSuffix) self.mnmultilistelem = "const NMatrixnet::TMnMultiCategPtr*" mnmultilisttype = "TMap< TString, {0} >".format(self.mnmultilistelem) self.mnmultilist = "const {0} {1}".format(mnmultilisttype, self.mnmultilistname) @@ -146,36 +146,36 @@ class BuildMns(BuildMnBase): self.srcfile = bmns_args[6] self.mninfos = bmns_args[7:] - self.InitBase(self.listname, self.mnrankingSuffix) + self.InitBase(self.listname, self.mnrankingSuffix) def InitForHeader(self, argv): - if len(argv) < 4: - print >>sys.stderr, "BuildMns.InitForHeader(<listname> <rankingSuffix> <hdrfile> <mninfos...>)" + if len(argv) < 4: + print >>sys.stderr, "BuildMns.InitForHeader(<listname> <rankingSuffix> <hdrfile> <mninfos...>)" sys.exit(1) self.listname = argv[0] - self.mnrankingSuffix = get_value(argv[1]) - self.hdrfile = argv[2] - self.mninfos = argv[3:] + self.mnrankingSuffix = get_value(argv[1]) + self.hdrfile = argv[2] + self.mninfos = argv[3:] - self.InitBase(self.listname, self.mnrankingSuffix) + self.InitBase(self.listname, self.mnrankingSuffix) def InitForCpp(self, argv): - if len(argv) < 5: - print >>sys.stderr, "BuildMns.InitForCpp(<listname> <rankingSuffix> <hdrfile> <srcfile> <mninfos...>)" + if len(argv) < 5: + print >>sys.stderr, "BuildMns.InitForCpp(<listname> <rankingSuffix> <hdrfile> <srcfile> <mninfos...>)" sys.exit(1) self.listname = argv[0] - self.mnrankingSuffix = get_value(argv[1]) - self.hdrfile = argv[2] - self.srcfile = argv[3] - self.mninfos = argv[4:] + self.mnrankingSuffix = get_value(argv[1]) + self.hdrfile = argv[2] + self.srcfile = argv[3] + self.mninfos = argv[4:] - self.InitBase(self.listname, self.mnrankingSuffix) + self.InitBase(self.listname, self.mnrankingSuffix) def InitForFiles(self, argv): - if len(argv) < 7: - print >>sys.stderr, "BuildMns.InitForFiles(<ARCADIA_ROOT> <BINDIR> <archiver> <fml_unused_tool> <listname> <rankingSuffix> <mninfos...> [CHECK])" + if len(argv) < 7: + print >>sys.stderr, "BuildMns.InitForFiles(<ARCADIA_ROOT> <BINDIR> <archiver> <fml_unused_tool> <listname> <rankingSuffix> <mninfos...> [CHECK])" sys.exit(1) bmns_args = [] @@ -216,10 +216,10 @@ class BuildMns(BuildMnBase): mnname = re.sub("[^-a-zA-Z0-9_]", "_", mnfilename) if ext == ".info": - mnname = "staticMn{0}{1}Ptr".format(self.mnrankingSuffix, mnname) + mnname = "staticMn{0}{1}Ptr".format(self.mnrankingSuffix, mnname) tmpHdrFile.write("extern const NMatrixnet::TMnSsePtr {0};\n".format(mnname)) elif ext == ".mnmc": - mnname = "staticMnMulti{0}{1}Ptr".format(self.mnrankingSuffix, mnname) + mnname = "staticMnMulti{0}{1}Ptr".format(self.mnrankingSuffix, mnname) tmpHdrFile.write("extern const NMatrixnet::TMnMultiCategPtr {0};\n".format(mnname)) tmpHdrFile.close() @@ -233,10 +233,10 @@ class BuildMns(BuildMnBase): mnname = re.sub("[^-a-zA-Z0-9_]", "_", mnfilename) if ext == ".info": - mnname = "staticMn{0}{1}Ptr".format(self.mnrankingSuffix, mnname) + mnname = "staticMn{0}{1}Ptr".format(self.mnrankingSuffix, mnname) super(BuildMns, self).Run(item, mnname, self.mnrankingSuffix, self.BINDIR + "/mn.{0}.cpp".format(mnname), check=self.check, ptr=True, multi=False) elif ext == ".mnmc": - mnname = "staticMnMulti{0}{1}Ptr".format(self.mnrankingSuffix, mnname) + mnname = "staticMnMulti{0}{1}Ptr".format(self.mnrankingSuffix, mnname) # BUILD_MN_PTR_MULTI super(BuildMns, self).Run(item, mnname, self.mnrankingSuffix, self.BINDIR + "/mnmulti.{0}.cpp".format(mnname), check=False, ptr=True, multi=True) diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 6d49d63459..081833998b 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -6849,8 +6849,8 @@ macro _BUILD_MNS_FILE(Input, Name, Output, Suffix, Check, Fml_tool, AsmDataName) .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsFilesF $ARCADIA_ROOT $BINDIR $ARCH_TOOL fml_tool=$Fml_tool $Name ranking_suffix=$Suffix ${input:Input} ${output;hide:Output} ${output;hide;pre=MN_External_;suf=.rodata:AsmDataName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} } -MNS_OUTPUT=mnmodels - +MNS_OUTPUT=mnmodels + macro _BUILD_MNS_CPP(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsCppF $NAME ranking_suffix=$RANKING_SUFFIX ${input:MNS_OUTPUT.h} ${output:MNS_OUTPUT.cpp} ${input:Files} ${output_include;hide:MNS_OUTPUT.h} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} } |