diff --git a/Proposal/.latexmkrc b/Proposal/.latexmkrc new file mode 100644 index 0000000..ce65316 --- /dev/null +++ b/Proposal/.latexmkrc @@ -0,0 +1,7 @@ +$pdf_mode = 1; +$pdflatex = "xelatex -file-line-error --shell-escape -src-specials -synctex=1 -interaction=nonstopmode %O %S;cp %D %R.pdf"; +$recorder = 1; +$clean_ext = "synctex.gz acn acr alg aux bbl bcf blg brf fdb_latexmk glg glo gls idx ilg ind ist lof log lot out run.xml toc dvi"; +$bibtex_use = 2; +$out_dir = "temp"; +$jobname = "BUPTBachelorThesisProposal"; diff --git a/Proposal/BUPTBachelor.bst b/Proposal/BUPTBachelor.bst new file mode 100644 index 0000000..b00b002 --- /dev/null +++ b/Proposal/BUPTBachelor.bst @@ -0,0 +1,2593 @@ +%% BUPTThesis.bst +%% +%% 北京邮电大学研究生学位论文参考文献 BibTeX 样式 +%% +%% 项目主页:http://code.google.com/p/buptthesis/ +%% +%% 本样式基于 IEEEtran 和 ThuThesis 修改而成,基本满足北京邮电大学研究生论文格式要求 +%% +%% 作者: +%% 张煜 (email:dazzlezhang@gmail.com) +%% +%% 更新记录: +%% $LastChangedBy$ +%% $LastChangedDate$ +%% $LastChangedRevision$ + +%% 一些设置的缺省值 +% 英文姓名排版格式字符串, 按~<, Jr.>格式 +FUNCTION {default.name.format.string} {"{vv~}{ll}{~ff}{, Jj}"} + +% 列出的最多作者数目, 即当作者数目超过下列数字时, 超出部分的作者姓名将略去 +FUNCTION {default.max.num.names.before.forced.et.al} { #3 } + +% 是否为盲审版本, #0 表示盲审将隐去作者信息, #1 表示非盲审 +FUNCTION {default.is.for.peer.review} { #0 } +%%%%%%%%%%%%%% +% 一些辅助函数 +%%%%%%%%%%%%%% +% #0 不在终端显示开始/完成的提示信息 +% #1 显示提示信息 +FUNCTION {is.print.banners.to.terminal} {#1} + +%%%%%%%%%%%%%%%% +% 版本与提示信息 +%%%%%%%%%%%%%%%% +% 版本信息 +FUNCTION{bst.file.version} { "0.2" } +FUNCTION{bst.file.date} { "2009/01/25" } +FUNCTION{bst.file.website} { + "http://code.google.com/p/buptthesis/" } + +% 开始提示信息 +FUNCTION {banner.message}{ + is.print.banners.to.terminal + { "-- BUPTThesis.bst version" " " * bst.file.version * + " (" * bst.file.date * ") " * "by Yu Zhang." * + top$ + "-- " bst.file.website * + top$ + "-- See the " quote$ * "userguide.pdf" * quote$ * + " manual for usage information." * + top$ + } + { skip$ } + if$ +} + +% 完成提示信息 +FUNCTION {completed.message} { + is.print.banners.to.terminal + { "" top$ "Done." top$ } + { skip$ } + if$ +} + +%%%%%%%%%%%%%%%%%%% +%% 预定义的字符串宏 +%%%%%%%%%%%%%%%%%%% +% 英文月份 +MACRO {jan} {"January"} +MACRO {feb} {"February"} +MACRO {mar} {"March"} +MACRO {apr} {"April"} +MACRO {may} {"May"} +MACRO {jun} {"June"} +MACRO {jul} {"July"} +MACRO {aug} {"August"} +MACRO {sep} {"September"} +MACRO {oct} {"October"} +MACRO {nov} {"November"} +MACRO {dec} {"December"} + +%%%%%%%%%%%% +%% 条目定义 +%%%%%%%%%%%% +ENTRY { address % 地址 + assignee % 标准授权人 + author % 作者 + booktitle % 专著/论文集名 + chapter % + day % + dayfiled % + edition % 版本 + editor % 编者 + howpublished % 出版形式 + esubtype % 电子文献子类 + institution % + journal % 期刊 + key % + language % 语言 + month % 月 + monthfiled % + nationality % + newsletter % + note % + number % + number2 % + organization % + pages % + publisher % + refdate % + update % 电子文档更新或修改日期 + school % + series % + title % + translator % + type % + volume % + volume2 % + year % + year2 % + yearfiled % + url % URL + pubaddress % 出版地 + CTLname_format_string % 作者英文姓名排版格式 + CTLmax_names_forced_etal % 强制略去的最大作者数 + CTLauthor_name_english % 作者英文姓名 + CTLauthor_name_chinese % 作者中文姓名 + CTLfor_peer_review % 是否匿名 + } + {} + { label } + +%%%%%%%%%%%%% +%% 字符串常量 +%%%%%%%%%%%%% +% FUNCTION {bbl.anonymous} { language empty$ { "Anon" } { "佚名" } if$ } +FUNCTION {bbl.anonymous} { "" } +FUNCTION {bbl.etal} { language empty$ { "~et~al" } { "~等" } if$ } +FUNCTION {bbl.sine.loco} { language empty$ { "S.~l." } { "出版地不详" } if$ } +FUNCTION {bbl.sine.nomine} { language empty$ { "s.~n." } { "出版者不详" } if$ } + +FUNCTION {bbl.comma} { language empty$ { ", " } { "," } if$ } +FUNCTION {bbl.colon} { language empty$ { ": " } { ":" } if$ } +FUNCTION {bbl.period} { language empty$ { "." } { "." } if$ } +FUNCTION {bbl.parallel} { "~//~" } + +FUNCTION {bbl.st} { "st" } % 序数词后缀 +FUNCTION {bbl.nd} { "nd" } % 序数词后缀 +FUNCTION {bbl.rd} { "rd" } % 序数词后缀 +FUNCTION {bbl.th} { "th" } % 序数词后缀 + +FUNCTION {bbl.number} { "第" } +FUNCTION {bbl.author} { "作者" } + +%%%%%%%%%%%% +%% 整型变量 +%%%%%%%%%%% +INTEGERS { output.state before.all mid.sentence after.title after.sentence url.sentence after.block before.pages } +INTEGERS { number.label longest.label.width multiresult + nameptr namesleft numnames lastnamecapitalized namelength charptr } +INTEGERS { max.num.names.before.forced.et.al } +INTEGERS { is.for.peer.review } + +%%%%%%%%%%%%% +%% 字符串变量 +%%%%%%%%%%%%% +STRINGS { s + t + longest.label + thename + name.emph.author.en % 强调现实的作者英文姓名 + name.emph.author.zh % 强调显示的作者中文姓名 + name.format.string % 姓名的格式字符串 + author.name.in.english % 作者英文姓名 + author.name.in.chinese % 作者中文姓名 +} + +%%%%%%%%%%%%%%%%%%%%% +%% LaTeX 参考文献代码 +%%%%%%%%%%%%%%%%%%%%% + +% 输出 .bbl 文件开始 +FUNCTION {begin.bib} { + "% Generated by BUPTThesis.bst, version: " bst.file.version * + " (" * bst.file.date * ")" * + write$ newline$ % 输出注释行,说明产生该bbl的bst及版本 + + preamble$ empty$ % 输出前导 + 'skip$ + { preamble$ write$ newline$ } + if$ + + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ % 输出 \begin{thebiliography}{x} +} + +% 输出 .bbl 文件结束部分 +FUNCTION {end.bib} { + newline$ + "\end{thebibliography}" + write$ newline$ +} + +%%%%%%%%%%%% +%% 底层函数 +%%%%%%%%%%%% + +% 控制变量初始化 +FUNCTION {initialize.controls} { + default.name.format.string 'name.format.string := + default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := + default.is.for.peer.review 'is.for.peer.review := +} + +% 初始化最长 label +FUNCTION {initialize.longest.label} { + "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +% 最长 label pass +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + { skip$ } + if$ +} + +% 逻辑非: 栈顶元素的逻辑非 +FUNCTION {not} { + { #0 } + { #1 } + if$ +} + +% 逻辑与 +FUNCTION {and} { + { skip$ } + { pop$ #0 } + if$ +} + +% 逻辑或 +FUNCTION {or} { + { pop$ #1 } + { skip$ } + if$ +} + +% 返回 #1 : 栈顶字符是数字"0"~"9" +% 返回 #0 : 其他 +FUNCTION {is.num} { + chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +% 栈顶整数乘以10 +FUNCTION {bump.int.mag} { + #0 'multiresult := % 初始化乘运算结果 y <- 0 + { duplicate$ #0 > } % 栈顶整数 x = 0 时才停止循环 + { #1 - % x <- x - 1 + multiresult #10 + + 'multiresult := % y <- y + 10 + } + while$ + pop$ % 释放 x + multiresult % y 压栈返回 +} + +% 将栈顶字符("0"~"9")转换为整数(0~9) +FUNCTION {char.to.integer} { + duplicate$ + is.num + { chr.to.int$ "0" chr.to.int$ - } + { "noninteger character " quote$ * swap$ * quote$ * + " in integer field of " * cite$ * warning$ + #0 % 如果栈定字符不是("0"~"9"), 给出警告返回 0 + } + if$ +} + +% 将栈顶字符串转换为整数 +FUNCTION {string.to.integer} { + duplicate$ text.length$ 'namesleft := % namesleft <- 字符串长度 + #1 'nameptr := % nameptr <- 1 + #0 'numnames := % numnames <- 0 + { nameptr namesleft > not } % while( ! ( nameptr > namesleft ) ) + { duplicate$ nameptr #1 substring$ % 取第 nameptr 个字符 x + char.to.integer numnames bump.int.mag + + 'numnames := % numnames <- chr2int( x ) + 10 * numnames + nameptr #1 + + 'nameptr := % nameptr <- nameptr + 1 + } + while$ + pop$ % 释放栈顶元素 + numnames % numnames 压栈返回 +} + +% convert the strings "yes" or "no" to #1 or #0 respectively +FUNCTION {yes.no.to.int} +{ "l" change.case$ duplicate$ + "yes" = + { pop$ #1 } + { duplicate$ "no" = + { pop$ #0 } + { "unknown boolean " quote$ * swap$ * quote$ * + " in " * cite$ * warning$ + #0 + } + if$ + } + if$ +} + +% 初始化状态常量 +FUNCTION {initialize.status.constants} +{ #0 'before.all := % 起始 + #1 'mid.sentence := % 句中 + #2 'after.sentence := % 句末 + #3 'after.block := % 块后 + #4 'after.title := % + #5 'before.pages := % +} + +FUNCTION {remove.char} +{ 't := + 's := + "" + { s empty$ not } + { s #1 #1 substring$ + s #2 global.max$ substring$ 's := + duplicate$ t = 'pop$ + { * } + if$ + } + while$ +} + +STRINGS {z} +FUNCTION {remove.period} +{ 'z := + "" + { z empty$ not } + { z #1 #1 substring$ + z #2 global.max$ substring$ 'z := + duplicate$ "." = 'pop$ + { * } + if$ + } + while$ +} + +FUNCTION {remove.dots} { + duplicate$ "input=" swap$ * warning$ + "language=" language * warning$ + language empty$ + { "." remove.char + duplicate$ "output('.')=" swap$ * warning$ } + { "." remove.char + duplicate$ "output('.')=" swap$ * warning$ + "." remove.char + duplicate$ "output('.')=" swap$ * warning$ } + if$ +} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +%%%%%%%%%%%% +%% 调试例程 +%%%%%%%%%%%% + +% 默认调试输出函数 +FUNCTION {debug.output} { + "[DEBUG] " swap$ * top$ +} + +% 状态调试输出函数 +FUNCTION {debug.output.status} { + "---- output.state=" + output.state before.all = + { "before.all" } + { output.state mid.sentence = + { "mid.sentence" } + { output.state after.sentence = + { "after.sentence" } + { output.state url.sentence = + { "url.sentence" } + { output.state before.pages = + { "before.pages" } + { "after.block" } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + * debug.output +} + +FUNCTION {output.year} +{ 't := + number empty$ + volume empty$ + and + { add.period$ write$ } + { ", " * write$ } + if$ + t +} + +% STRINGS {z} +% FUNCTION {remove.dots} +% { 'z := +% "" +% { z empty$ not } +% { z #1 #1 substring$ +% z #2 global.max$ substring$ 'z := +% duplicate$ bbl.period = 'pop$ +% { * } +% if$ +% } +% while$ +% %z +% } + +% 对于中文文献, 用全角句点替换英文句点 +FUNCTION {replace.half.width.period} { +% % DEBUG +% duplicate$ "-- replace.half.width.period(" swap$ * ")" * debug.output +% % END OF DEBUG + language empty$ + { " " * } % 对于英文文献, 在句点后加一空格 + { duplicate$ text.length$ 'numnames := % numnames 等于字符串长度 +% % DEBUG +% numnames int.to.str$ "---- text.length$=" swap$ * debug.output +% % END OF DEBUG + duplicate$ numnames #1 substring$ "." = + { % % DEBUG +% "---- Found '.' at the end" debug.output +% % END OF DEBUG + numnames #1 - + #1 swap$ substring$ + bbl.period * + } + { skip$ } + if$ + } + if$ +% % DEBUG +% duplicate$ "---- Return=" swap$ * debug.output +% % END OF DEBUG +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 输出例程: 输出栈顶项并根据需要添加标点符号 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% 非空项输出函数: 用于输出非空项 +FUNCTION {output.nonnull} { +% % DEBUG +% duplicate$ "output.nonnull(" swap$ * ")" * debug.output +% debug.output.status +% % END OF DEBUG + swap$ + % 根据当前输出状态添加前置标点符号 + % before.all 起始, 不添加任何标点符号直接输出 + % mid.sentence 句中, 前置逗号输出 + % after.sentence 句末, 前置句号输出 + % after.block 块后, 前置句号, 后置 \newblock 输出 + % after.title + output.state mid.sentence = + { bbl.comma * write$ } % mid.sentence 前置逗号 + { output.state after.block = + { add.period$ % 块后, 后置句号 + replace.half.width.period % 为中文文献替换句点 + write$ + newline$ +% "\newblock " write$ + } % 后置 \newblock 输出 + { output.state before.all = + { write$ } % 起始, 不添加任何标点符号直接输出 + { output.state after.title = + { bbl.parallel * + write$ } + { output.state before.pages = + { bbl.colon * + write$ } + { add.period$ % 句末, 前置句号输出 + replace.half.width.period + write$ } % + if$ + } + if$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + % s +} + +% 无警告输出函数 +FUNCTION {output} { + duplicate$ empty$ + { pop$ } % 若输出项为空, 则舍去空输出项 + { output.nonnull } % 否则调用非空输出函数 + if$ +} + +% 警告输出函数: 同 output, 但是对于空项给出警告提示 +FUNCTION {output.warn} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + { output.nonnull } + if$ +} + +% 将数字字符串转换成序数词形式字符串(例如: "7" -> "7th") +FUNCTION {num.to.ordinal} { + duplicate$ #-1 #1 substring$ "1" = + { bbl.st * } + { duplicate$ #-1 #1 substring$ "2" = + { bbl.nd * } + { duplicate$ #-1 #1 substring$ "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ +} + +% 从字符串中提取前导数字的函数 +% 如果栈顶字符串以数字开头(例如: "11th"), 则将字符串用其数字部分(即,"11") +% 替换. 否则, 保持原字符串不变. 用于版本转换函数(convert.edition) +% s 保存提取出的数字, t 保存剩余待扫描的字符串. +FUNCTION {extract.num} { + duplicate$ 't := % t <- 输入字符串 + "" 's := % s <- "" + { t empty$ not } % while( t != "" ) { + { t #1 #1 substring$ % tmp <- t[0] + t #2 global.max$ substring$ + 't := % t <- t[2:global.max$] + duplicate$ is.num % if( is.num( tmp ) ) + { s swap$ * 's := } % s <- s & tmp + { pop$ "" 't := } % else t <- "" + if$ % } + } % + while$ % if( s == "" ) + s empty$ % ; + 'skip$ % else + { pop$ s } % return s + if$ % +} + +% 将1st~10th单词形式的序数词转换成阿拉伯数字形式 +FUNCTION {word.to.num} { + duplicate$ "l" change.case$ + 's := % s <- lower( arg ) + s "first" = % if ( s == "first" ) + { pop$ "1" } % return "1" + { skip$ } + if$ + s "second" = % if ( s == "second" ) + { pop$ "2" } % return "2" + { skip$ } + if$ + s "third" = + { pop$ "3" } + { skip$ } + if$ + s "fourth" = + { pop$ "4" } + { skip$ } + if$ + s "fifth" = + { pop$ "5" } + { skip$ } + if$ + s "sixth" = + { pop$ "6" } + { skip$ } + if$ + s "seventh" = + { pop$ "7" } + { skip$ } + if$ + s "eighth" = + { pop$ "8" } + { skip$ } + if$ + s "ninth" = + { pop$ "9" } + { skip$ } + if$ + s "tenth" = + { pop$ "10" } + { skip$ } + if$ +} + +% 转换字符串形式的序数词为数字形式的序数词 +% 例如: 将 "Eleventh" 转换为 "11th" +FUNCTION {convert.edition} { + duplicate$ empty$ 'skip$ + { duplicate$ #1 #1 substring$ + is.num % if( is.num( arg[1] ) ) { + { extract.num % tmp <- extract.num( arg ) + num.to.ordinal % tmp <- num.to.ordinal( tmp ) + } % } else { + { word.to.num % tmp <- word.to.num( arg ) + duplicate$ #1 #1 substring$ + is.num % if( is.num( tmp[1] ) ) + { num.to.ordinal } % tmp <- num.to.ordinal( tmp ) + { "edition ordinal word " + quote$ * edition * quote$ * + " may be too high (or improper) for conversion" * + " in " * cite$ * warning$ % else output warning + } + if$ + } + if$ + } + if$ +} + +FUNCTION {start.entry} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {fin.entry} +{ add.period$ + replace.half.width.period + write$ + newline$ +} + +% FUNCTION {fin.entry} +% { duplicate$ empty$ +% 'pop$ +% 'write$ +% if$ +% newline$ +% } + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + + + + + +FUNCTION {format.language} +{ language empty$ + 'skip$ + 'skip$ + if$ + } +FUNCTION {is.space} +{ chr.to.int$ + duplicate$ #32 = + { pop$ #1 } + { pop$ #0 } + if$ +} +FUNCTION {is.lower.char} +{ + chr.to.int$ + duplicate$ #96 > + { #123 < + { #1 } + { #0 } + if$ + } + { pop$ #0 } + if$ +} + +% 将last name转换为全大写 +FUNCTION {capitalize.last.name} { + "u" change.case$ +} +% FUNCTION {capitalize.last.name} +% { +% 'thename := % 输入参数 thename +% thename text.length$ +% 'namelength := % namelength := thename 的长度 +% #1 'charptr := +% #0 'lastnamecapitalized := +% "" + +% { charptr #1 - namelength < +% % % debug +% % duplicate$ int.to.str$ "( charptr + #1 > namelength ) == " swap$ * warning$ +% % % eod +% } +% { +% % % debug +% % "charptr = " charptr int.to.str$ * +% % ", lastnamecapitalized = " * +% % lastnamecapitalized int.to.str$ * warning$ +% % % eod +% lastnamecapitalized #1 = +% { thename charptr namelength charptr - #1 + substring$ * +% namelength #1 + 'charptr := +% % % debug +% % duplicate$ "top of the stack = " swap$ * warning$ +% % % eod +% } +% { thename charptr #1 substring$ +% % % debug +% % duplicate$ "the char = " swap$ * warning$ +% % % eod +% duplicate$ is.lower.char +% % % debug +% % duplicate$ int.to.str$ "is.lower.char = " swap$ * warning$ +% % % eod +% { "u" change.case$ * } +% { duplicate$ is.space +% % % debug +% % duplicate$ int.to.str$ "is.space = " swap$ * warning$ +% % % eod +% { #1 'lastnamecapitalized := +% * +% } +% { * +% } +% if$ +% } +% if$ +% % % debug +% % duplicate$ "top of the stack = " swap$ * warning$ +% % % eod +% charptr #1 + 'charptr := +% } +% if$ +% } +% while$ +% } +% 格式化盲审姓名 +FUNCTION {format.names.for.peer.review} { + 's := % s := author域 + #1 'nameptr := % nameptr 是姓名指针,初始化为 1 + s num.names$ 'numnames := % 利用 num.names$ 获得 s 中的作者数量存入 nameptr + numnames 'namesleft := % 未处理的姓名数 namesleft := numnames + % 循环处理所有姓名 + { namesleft #0 > } % if namesleft > #0 (还有姓名没有格式化) + { s nameptr % 选择第 nameptr 个姓名 + name.format.string % 按 name.format.string 的格式排版 + format.name$ % 调用 format.name$ + remove.period % 并删除缩写符号'.' + 't := % 格式化后的姓名暂存于 t + language empty$ + { author.name.in.english }% 如果是英文文献将 author.name.in.english 压栈 + { author.name.in.chinese } % 否则将 author.name.in.chinese 压栈 + if$ + t = % 用当前的姓名与栈上的姓名做比较 + { nameptr int.to.str$ % 将作者序号转化为字符串 + "\CJKnumber{" swap$ * "}" * % 使用中文数字 + bbl.number swap$ * bbl.author * % 加上``第''和``作者'' +% duplicate$ debug.output + } + { skip$ } + if$ + nameptr #1 + 'nameptr := % 姓名指针加 1 + namesleft #1 - 'namesleft := % 剩余姓名数减 1 + } + while$ +} +% 格式化非盲审姓名 +FUNCTION {format.names.for.non.peer.review} { + % 初始化 + 's := % s := author域 + #1 'nameptr := % nameptr 是姓名指针,初始化为 1 + s num.names$ 'numnames := % 利用 num.names$ 获得 s 中的作者数量存入 nameptr + numnames 'namesleft := % 未处理的姓名数 namesleft := numnames + % 循环处理所有姓名 + { namesleft #0 > } % if namesleft > #0 (还有姓名没有格式化) + { s nameptr % 选择第 nameptr 个姓名 + name.format.string % 按 name.format.string 的格式排版 + format.name$ % 调用 format.name$ +% language empty$ +% { "u" change.case$ } % 如果不是语言为空, 做大写转换 +% { skip$ } +% if$ % + remove.period % 并删除缩写符号'.' + 't := % 格式化后的姓名暂存于 t + nameptr #1 > + { nameptr max.num.names.before.forced.et.al #1 + = + { "others" 't := % 如果当前作者的序数已经超出了最大列显作者数 + #1 'namesleft := } % 则置未处理姓名数为#1, 以便跳出循环 + { bbl.comma * } % 如果作者序数在允许范围内, 则添加逗号 + if$ % + namesleft #1 > % 若当前姓名不是最后一个 + { t * } % 显示当前姓名 + { t "others" = % 若当前姓名是最后一个且后面有略去的姓名 + { bbl.etal * } % 添加", et~al"或",等" + { t * } % 如果没有略去姓名,以句点结束 + if$ % + } + if$ % + } + { t } % 如果是第一个作者, 直接将排版后的姓名压栈 + if$ + nameptr #1 + 'nameptr := % 姓名指针加 1 + namesleft #1 - 'namesleft := % 剩余姓名数减 1 + } + while$ +} +% 格式化姓名 +FUNCTION {format.names} { + is.for.peer.review + { format.names.for.peer.review } % 格式化盲审姓名 + { format.names.for.non.peer.review } % 格式化非盲审姓名 + if$ +} +FUNCTION {format.authors} +{ author empty$ + { bbl.anonymous + "The author in " cite$ * " is missing." * warning$ } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { bbl.anonymous + "The editor in " cite$ * " is missing." * warning$ + } + { editor format.names } + if$ +} + +FUNCTION {format.assignees} { + assignee empty$ + { "" } + { assignee format.names } + if$ +} + +% 译者格式 +FUNCTION {format.translators} +{ translator empty$ + { "" } % 无译者 + { new.block % 有译者 + translator format.names ",译" * + } + if$ +} + +% 机构格式 +FUNCTION {format.institution} { + institution empty$ + { "" } + { institution } + if$ +} + +% 组织格式 +FUNCTION {format.organization} { + organization empty$ + { "" } + { organization } + if$ +} + +% 文献类型标志代码/电子文献载体标志代码 +FUNCTION {bib.type.designator} { +% % DEBUG +% "bib.type.designator(type:" type$ * debug.output +% " url: " url empty$ { "" }{ url } if$ * debug.output +% % END OF DEBUG + + % 文献类型标志代码 + type$ "book" = type$ "inbook" = or + { "M" } + { type$ "standard" = + { "S" } + { type$ "proceedings" = type$ "conference" = or type$ "inproceedings" = or + { "C" } + { type$ "patent" = + { "P" } + { type$ "phdthesis" = type$ "masterthesis" = or + {language "Chinese" = { "学位论文" } { language empty$ = {"Dissertation"} if$} if$} + { type$ "techreport" = + { "R" } + { type$ "article" = type$ "periodical" = or + { "J" } + { type$ "online" = type$ "webpage" = or type$ "www" = or + { "EB" } + { type$ "electronic" = + { esubtype empty$ + { url empty$ + { "" } + { "EB" } + if$ + } + { esubtype "webpage" = + { "EB" } + { esubtype "database" = + { "DB" } + { esubtype "program" = + { "CP" } + { "" } + if$ % electronics[program] + } + if$ % electronics[database] + } + if$ % electronics[webpage] + } + if$ + } + { "" } % 其他 + if$ % electronics + } + if$ % online/webpage/www + } + if$ % article/periodical + } + if$ % techreport + } + if$ % phdthesis/mastersthesis + } + if$ % patent + } + if$ % proceedings/inproceedings/conference + } + if$ % standard + } + if$ % book/inbook +% % DEBUG +% duplicate$ " doc.designator: " swap$ * debug.output +% % END OF DEBUG + % 电子文献载体标志代码 + duplicate$ "" = + { skip$ } + { "~[" swap$ * + howpublished empty$ + { url empty$ + { "" } + { "/OL" } + if$ + } + { howpublished "online" = + { "/OL" } + { howpublished "magtype" = + { "MT" } + { howpublished "disk" = + { "DK" } + { howpublished "cdrom" = + { "CD" } + { "" } + if$ % cdrom + } + if$ % disk + } + if$ % magitude type + } + if$ % online + } + if$ + * "]" * + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { new.block + title } + if$ +} + +% 格式化年月日``YYYY-MM-DD'' +FUNCTION {format.year.month.day} { + year empty$ + { "YYYY" } + { year } + if$ + "-" * + month empty$ + { "MM" * } + { month text.length$ #2 < + { "0" * } + { skip$ } + if$ + month * + } + if$ + "-" * + day empty$ + { "DD" * } + { day text.length$ #2 < + { "0" * } + 'skip$ + if$ + day * + } + if$ +} + +FUNCTION {format.reference.date} { + refdate empty$ + { "" + url empty$ + { skip$ } + { "The refdate in " cite$ * " is missing." * warning$ } + if$ + } + { output.state mid.sentence = + { before.all 'output.state := } + { skip$ } + if$ + "~[" refdate * "]" * } + if$ +} + +% patent的题名项: 专利题名: 专利国别, 专利号~[文献类型标志] +FUNCTION {format.patent.title} { + title empty$ % 专利提名 + { "" } + { new.block + title bbl.colon * + nationality empty$ % 专利国别, 专利号 + { % 专利国别为必备项 + "The nationality in " cite$ * " is missing." * warning$ + } + { number empty$ + { % 专利号为必选项 + "The number in " cite$ * " is missing." * warning$ + } + { % 产生``专利国别, 专利号'' + nationality * bbl.comma * number * + } + if$ + } + if$ + % 文献类型标志 + bib.type.designator * + } + if$ +} + +% patent的出版项: +FUNCTION {format.patent.publication} { + new.block + format.year.month.day +% % DEBUG +% duplicate$ "End of format.patent.publication, top = " swap$ * debug.output +% % END OF DEBUG + url empty$ + { skip$ } + { refdate empty$ + { "The refdate in " cite$ * " is missing." * warning$ } + { "~[" * refdate * "]" * } + if$ + } + if$ +} + +% electronic的主要责任者: +% author 或 organization +FUNCTION {format.electronic.authors} +{ + author empty$ + { organization empty$ + { " " } + { organization } + if$ + } + { format.authors } + if$ +} + +% electronic的出版项 +FUNCTION {format.electronic.publication} { + new.block + % 出版地: 出版者 + address empty$ + { "" } + { address + publisher empty$ + { skip$ } + { bbl.colon * publisher * } + if$ + } + if$ + + % 出版年 + year empty$ + { skip$ } + { publisher empty$ + { "" } + { bbl.comma } + if$ + * year * } + if$ +} + +%% article的标题格式 +FUNCTION {format.atitle} +{ title empty$ + { "" } + { title + newsletter empty$ + { "~[J" * } + { newsletter "yes" = + { "~[N" * } + { "~[J" * } + if$ + } + if$ + url empty$ + { "]" * } + { "/OL]" * } + if$ + } + if$ +} +%% incollection的标题格式 +FUNCTION {format.ictitle} +{ title empty$ + { "" } + { title "~[M]~//~" * + editor format.names * + } + if$ +} +%% inproceedings的标题格式 +FUNCTION {format.iptitle} +{ title empty$ + { "" } + { title "~[C]~//~" * + editor format.names * + } + if$ +} + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +% 年,卷(期) +FUNCTION {format.year.volume.number} { + year empty$ + { "" } + { type$ "periodical" = + { new.block } + { mid.sentence 'output.state := } + if$ + year + volume empty$ + 'skip$ + { bbl.comma * volume * } + if$ + number empty$ + 'skip$ + { "~(" * number * ")" * } + if$ + year2 empty$ + { skip$ } + { "~--" * + year2 "now" = + { skip$ } + { year2 * + volume2 empty$ + { skip$ } + { bbl.comma * volume2 * } + if$ + number2 empty$ + 'skip$ + { "~(" * number2 * ")" * } + if$ + } + if$ + } + if$ + } + if$ +% %% DEBUG +% duplicate$ "format.year.volume.number=" swap$ * debug.output +% %% END OF DEBUG +} + +% 卷(期).年,月(for article only) +FUNCTION {format.volume.number.year.month} { + add.period$ + year empty$ + { "" } + { + volume empty$ + 'skip$ + { "~" * volume * } + if$ + number empty$ + 'skip$ + { "~(" * number * ")" * } + if$ + new.block + year + month empty$ + 'skip$ + { bbl.comma * month * } + if$ + } + if$ +} + +% +FUNCTION {format.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$ + month + } + if$ + } + { month empty$ + { year } + { month bbl.comma * year * } + if$ + } + if$ +} + +function {format.year.year} +{ year empty$ + 'skip$ + { year "--" * + year2 empty$ + 'skip$ + { year2 "now" = + 'skip$ + { year2 * } + if$ + } + if$ + } + if$ +} + +% 专著标题格式 +FUNCTION {format.book.title} { + new.block % 生成一个新的block + title + type$ "proceedings" = + { address empty$ + { skip$ } + { bbl.comma * address * bbl.comma * + month empty$ + { skip$ } + { month * } + if$ + year empty$ + { skip$ } + { year * } + if$ + } + if$ + } + { skip$ } + if$ + bib.type.designator * % 标题 + [文献标志代码/电子文献载体标志代码] +} + +% 科技报告标题格式 +FUNCTION {format.techreport.title} { + title empty$ + { "" } + { new.block % 生成一个新的block + title % 标题 + + number empty$ % 编号 + + { "" } + { bbl.comma * number } + if$ * + bib.type.designator * % [文献标志代码/电子文献载体标志代码] + } + if$ +} + +% 连续出版物标题格式 +FUNCTION {format.jtitle} +{ title "~[J" * + url empty$ + { "]" * } + { "/OL]" * } + if$ +} + +% 论文集标题格式 +FUNCTION {format.ptitle.volume} +{ title + volume empty$ + { "~[C]" } + { bbl.colon volume * "~[C]" * } + if$ * + %emphasize +} +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { language empty$ + { "volume" volume tie.or.space.connect } + { volume } + if$ + series empty$ + 'skip$ + { " of " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "number" } + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " in " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +% 版本项格式 +FUNCTION {format.edition} { + edition empty$ + { "" } + { new.block % 版本项按一个block输出 + language empty$ % 英文文献版本号自动转换成数字形式的序数词 + { edition convert.edition + "l" change.case$ " ed" * + } + { edition } % 中文文献版本号直接输出 + if$ + } + if$ +} + + +FUNCTION {format.url} +{ url empty$ + { "" } + { new.block + "\url{" url * "}" * + } + if$ +} + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { before.pages 'output.state := + pages multi.page.check + { "" pages n.dashify tie.or.space.connect } + { "" pages tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + number empty$ + 'skip$ + { "(" number * ")" * * + volume empty$ + { newsletter empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + 'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { bbl.colon * pages n.dashify * } + if$ + } + if$ + % duplicate$ "top of stack = " swap$ * warning$ + url empty$ + 'skip$ + { refdate empty$ + { "there's an url but no refdate in " cite$ * warning$ } + { %duplicate$ "url and refdate is not empty, top of stack = " swap$ * warning$ + "~[" * refdate * "]" * + } + if$ + %duplicate$ "top of stack = " swap$ * warning$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + { "" } + { type empty$ + { "chapter" } + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { language empty$ + { " " booktitle * } + % { "Proceedings of " booktitle * } + { " " booktitle * } + if$ + } + { language empty$ +% { "In: " format.editors * ", Proceedings of " * booktitle * } + { " " booktitle * } + { " " booktitle * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle.volume} +{ booktitle empty$ + { "" } + { editor empty$ + { language empty$ +% { "Proceedings of " booktitle * } + { " " booktitle * } + { " " booktitle * } + if$ + } + { language empty$ + %{ "In: " format.editors * ", Proceedings of " * booktitle * } + { " " booktitle * } + { " " booktitle * } + if$ + } + if$ + %% volume + volume empty$ + 'skip$ + { language empty$ + { "Vol." * volume * } + { ":第" * volume * "卷" * } + if$ + } + if$ + } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { "In {\em " journal * "\/}" * } + if$ + } + { "In " key * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ editor #1 "{ll }{f{~}}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { editor #2 "{ll }{f{~}}" format.name$ "others" = + { " et~al." * } + { " and " * editor #2 "{ll }{f{~}}" format.name$ * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "In " + } + { "Volume" volume tie.or.space.connect + " of " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "{\em " * series * "\/}" * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "In {\em " booktitle * "\/}" * } + if$ + } + { "In " key * } + if$ + } + { "In " format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +% 出版地: 出版者 +FUNCTION {format.address.publisher} { + new.block + type$ "inproceedings" = + { pubaddress empty$ + { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地 + publisher empty$ + { "there's neither pubaddress nor publisher in " cite$ * warning$ + "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { "there's a publisher but no pubaddress in " cite$ * warning$ + publisher * % 有出版者 + } + if$ + } + { pubaddress bbl.colon * % 有出版地 + publisher empty$ + { "there's a pubaddress but no publisher in " cite$ * warning$ + "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { publisher * } % 有出版者 + if$ + } + if$ + } + { address empty$ + { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地 + publisher empty$ + { "there's neither address nor publisher in " cite$ * warning$ + "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { "there's a publisher but no address in " cite$ * warning$ + publisher * % 有出版者 + } + if$ + } + { address bbl.colon * % 有出版地 + publisher empty$ + { "there's a address but no publisher in " cite$ * warning$ + "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { publisher * } % 有出版者 + if$ + } + if$ + } + if$ +} + +% 出版地: 出版者, 出版年 +FUNCTION {format.address.publisher.year} { +% % DEBUG +% "-- format.address.publisher.year(){" debug.output +% "-- address =" address * debug.output +% "-- publisher=" publisher * debug.output +% "-- year =" year * debug.output +% % END OF DEBUG + new.block + type$ "inproceedings" = + { pubaddress empty$ + { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地 + publisher empty$ + { "there's neither pubaddress nor publisher in " cite$ * warning$ + "" * % "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { "there's a publisher but no pubaddress in " cite$ * warning$ + publisher * % 有出版者 + } + if$ + } + { publisher empty$ + { "there's a pubaddress but no publisher in " cite$ * warning$ + "" % "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { pubaddress bbl.colon * % 有出版地 + publisher * } % 有出版者 + if$ + } + if$ + } + { address empty$ + { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地 + publisher empty$ + { "there's neither address nor publisher in " cite$ * warning$ + "" * % "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { "there's a publisher but no address in " cite$ * warning$ + publisher * % 有出版者 + } + if$ + } + { publisher empty$ + { "there's a address but no publisher in " cite$ * warning$ + "" % "[" * bbl.sine.nomine * "]" * % 无出版者 + } + { address bbl.colon * % 有出版地 + publisher * } % 有出版者 + if$ + } + if$ + } + if$ + + % 出版年 + year empty$ + { "there's no year in " cite$ * warning$ } + { type$ "inproceedings" = + { bbl.comma * year * } + { publisher empty$ + { year * } + { bbl.comma * year * } + if$ + } + if$ + + type$ "periodical" = + { year2 empty$ % 对连续出版物可以排版 year2 + { skip$ } + { "--" * + year2 "l" change.case$ "now" = + { skip$ } + { year2 * } + if$ + } + if$ + } + { skip$ } + if$ + } + if$ +% % DEBUG +% duplicate$ "-- }=" swap$ * debug.output +% % END OF DEBUG +} + +% 出版地: 学校, 出版年 +FUNCTION {format.address.school.year} { + new.block + address empty$ + { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地 + school empty$ + { "there's neither address nor school in " cite$ * warning$ + "[" bbl.sine.nomine * "]" * % 无出版者 + } + { "there's a school but no address in " cite$ * warning$ + school * % 有出版者 + } + if$ + } + { address bbl.colon * % 有出版地 + school empty$ + { "there's a address but no school in " cite$ * warning$ + "[" bbl.sine.nomine * "]" * % 无出版者 + } + { school * } % 有出版者 + if$ + } + if$ + % 出版年 + year empty$ + { "there's no year in " cite$ * warning$ } + { bbl.comma * year * } + if$ +} + + +% FUNCTION {format.title.type} +% { title empty$ +% { type empty$ +% { "" } +% { "there's a type but no title in " cite$ * warning$ +% type +% } +% if$ +% } +% { type empty$ +% 'title +% { title bbl.colon * type * } +% if$ +% } +% if$ +% } + +FUNCTION {format.note} { + note empty$ + { new.block "" } + { url empty$ + { new.block } + { before.all 'output.state := } + if$ + note + } + if$ +} + +%%%%%%%%%%%%%%%%% +%% 著录格式: 专著 +%%%%%%%%%%%%%%%%% + +% 普通图书 +FUNCTION {book} { + start.entry % 开始 + + author empty$ % 主要责任者 + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + format.book.title "title" output.warn % 题名项 + format.translators output % 其他责任者(可选) + format.edition output % 版本项 + format.address.publisher.year output.nonnull % + format.reference.date output % + format.url output % 获取或访问路径 + format.note output % 备注 + + fin.entry +} + +% 标准 +FUNCTION {standard} { + start.entry + + organization empty$ % 主要责任人 + { format.institution "organization and institution" output.warn } + { format.organization output.nonnull } + if$ + format.book.title "title" output.warn % 题名项 + format.translators output % 其他责任人 + format.edition output % 版本项 + format.address.publisher.year output.nonnull % 出版项 + format.url output % URL + format.note output % 备注项 + + fin.entry +} + +% 学位论文 +FUNCTION {phdthesis} { + start.entry + + format.authors "author" output.warn + format.book.title "title" output.warn + format.address.school.year output + format.note output + + fin.entry +} + +% 会议录/论文集 +FUNCTION {proceedings} { + start.entry + + editor empty$ + { organization empty$ + { format.institution "author, organization institution" output.warn } + { format.organization output.nonnull } + if$ + } + { format.editors output.nonnull } + if$ + format.book.title "title" output.warn + format.address.publisher.year output + format.note output + + fin.entry +} + +% 科技报告 +FUNCTION {techreport} { + start.entry + + author empty$ + { organization empty$ + { format.institution + "author, organization and institution" output.warn } + { format.organization output.nonnull } + if$ + } + { format.authors output.nonnull } + if$ + format.techreport.title "title" output.warn + format.address.publisher.year output.nonnull + format.url output + format.note output + + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 著录格式: 专著中析出的文献 +%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.collection.editors} { + booktitle empty$ + { "" } + { after.title 'output.state := + format.editors } + if$ +} +FUNCTION {format.address} { + booktitle empty$ + { new.block } + { mid.sentence 'output.state := } + if$ + address empty$ + { "" } + { + new.block + address + } + if$ +} + +FUNCTION {format.month.year} { + month empty$ + { "" } + { month " " * } + if$ + year empty$ + { "There is month but no year in " cite$ * warning$ } + { year * } + if$ +} + +FUNCTION {format.year} { + year empty$ + { "There is month but no year in " cite$ * warning$ } + { new.block + year " " * + } + if$ +} + +FUNCTION {format.collection.title} { + booktitle empty$ + { "" } + { new.block + language empty$ + {"In "} + {"见"} + if$ + booktitle * +% address empty$ +% { skip$ } +% { bbl.comma * address * bbl.comma * +% month empty$ +% { skip$ } +% { month * } +% if$ +% year empty$ +% { skip$ } +% { " " * year * } +% if$ +% } +% if$ + } + if$ +} +% 图书中析出的文献 +FUNCTION {inbook} { + start.entry + + author empty$ + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + format.book.title "title" output.warn + format.collection.editors "editor" output.warn + format.collection.title "booktitle" output.warn + format.translators output % 其他责任人 + format.edition output % 版本项 + format.address.publisher.year output.nonnull % 出版项 + format.pages "pages" output.warn % + format.url output % URL + format.note output % 备注项 + + fin.entry +} + +%%%%%%%%%%%%%%%%% +%% 著录格式: 专利 +%%%%%%%%%%%%%%%%% +FUNCTION {patent} { + start.entry + + author empty$ + { format.assignees "assignee" output.warn } + { format.authors output.nonnull } + if$ + format.patent.title "title" output.warn + format.patent.publication output + format.url output + format.note output + + fin.entry +} + +% 电子文献更新或修改日期 +FUNCTION {format.update.date} { + update empty$ + { "" } + { output.state mid.sentence = + { before.all 'output.state := } + { skip$ } + if$ + "~(" update * ")" * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%% +%% 著录格式: 电子文献 +%%%%%%%%%%%%%%%%%%%%% +FUNCTION {electronic} { + start.entry + + author empty$ + { organization "author and organization" output.warn } + { format.authors output.nonnull } + if$ + format.book.title output + format.electronic.publication output + format.update.date output + format.reference.date output + format.url output + format.note output + + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%% +%% 著录格式: 连续出版物 +%%%%%%%%%%%%%%%%%%%%%%% +FUNCTION {periodical} { + start.entry + + editor empty$ + { format.organization "editors and organization" output.warn } + { format.editors output.nonnull } + if$ + format.book.title "title" output.warn + format.year.volume.number output + format.address.publisher.year output + format.url output + format.note output + + fin.entry +} + +FUNCTION {format.journal.title} { + journal empty$ + { "" } + { new.block journal } + if$ +} + +% 连续出版物中析出的文献 +FUNCTION {article} +{ start.entry + + format.authors "author" output.warn + format.book.title "title" output.warn + format.journal.title "journal" output.warn + format.volume.number.year.month output + %format.year.volume.number output + format.pages "pages" output.warn + format.reference.date output + format.url output + format.note output + + fin.entry +} + +FUNCTION {booklet} +{ start.entry + format.authors output + new.block + format.title "title" output.warn + howpublished address new.block.checkb + howpublished output + address output + format.date output + new.block + note output + fin.entry +} + +FUNCTION {incollection} +{ start.entry + format.authors "author" output.warn + new.block + format.ictitle "title" output.warn + new.block + crossref missing$ + { %format.in.ed.booktitle "booktitle" output.warn + %format.bvolume output + format.in.ed.booktitle.volume "booktitle" output.warn + format.number.series output + format.chapter.pages output + new.sentence +% publisher "publisher" output.warn +% address output + format.address.publisher.year output + format.edition output + format.date ":" * format.pages * output + %format.date "year" output.warn + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + note output + fin.entry +} + +% 论文集中析出的文献 +FUNCTION {inproceedings} { + start.entry + + format.authors "author" output.warn + format.book.title "title" output.warn +% format.collection.editors "editor" output.warn + format.collection.title "booktitle" output.warn + format.address output +% format.month.year output + format.year output +% format.address.publisher.year output.nonnull % 出版项 + format.pages "pages" output.warn % +% format.url output % URL +% format.note output % 备注项 +% format.in.booktitle "booktitle" output.warn +% %format.bvolume output +% %format.number.series output +% %format.pages output +% address empty$ +% { organization publisher new.sentence.checkb +% organization output +% publisher output +% %format.date "year" output.warn +% %year output +% format.date ":" * format.pages * output +% } +% { %address output.nonnull +% format.address.publisher.year output +% %format.date "year" output.warn +% % year output +% format.date ":" * format.pages * output +% new.sentence +% organization output +% %publisher output +% } +% if$ +% new.block + % pages output + %remove.dots + +% { format.incoll.inproc.crossref output.nonnull +% format.pages output +% } +% if$ +% new.block +% note output + fin.entry +} + +FUNCTION {manual} +{ start.entry + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull + address output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + format.book.title "title" output.warn + author empty$ + { organization empty$ + { address new.block.checka + address output + } + 'skip$ + if$ + } + { organization address new.block.checkb + organization output + address output + } + if$ + format.edition output + format.date output + new.block + note output + fin.entry +} + +FUNCTION {thesis.type} +{ +%"~[D]" + language empty$ + { "[Dissertation]" } + { "[学位论文]" } + if$ +} + +FUNCTION {masterthesis} + { start.entry + format.authors "author" add.period$ output.warn + new.block + format.title remove.dots " " * thesis.type * output + new.block + %format.address.school output + %address output + school "school" output.warn + format.date "year" output.warn + new.block + %note output + fin.entry + } + +%FUNCTION {phdthesis} + %{ start.entry + % format.authors "author" add.period$ output.warn + %new.block + %format.title remove.dots " " * thesis.type * output + %new.block + %format.address.school output + %%address output + %school "school" output.warn + %format.date "year" output.warn + %new.block + %%note output + %fin.entry + %} + +FUNCTION {misc} +{ start.entry + + format.authors output +% title howpublished new.block.checkb + format.title output +% howpublished new.block.checka +% howpublished output +% format.date output + format.address output + format.month.year output + format.pages "pages" output.warn + format.url output +% new.block + format.note output + fin.entry +% empty.misc.check +} + + +FUNCTION {unpublished} +{ start.entry + format.authors "author" output.warn + new.block + format.title "title" output.warn + new.block + note "note" output.warn + format.date output + fin.entry +} + +% 专用控制条目 BUPTThesisBSTCTL 用于提供方便的用户设置接口 +FUNCTION {BUPTThesisBSTCTL}{ + is.print.banners.to.terminal + { "** BUPTThesis BST control entry " quote$ * cite$ * + quote$ * " detected." * + top$ + } + { skip$ } + if$ +% CTLuse_article_number +% empty$ +% { skip$ } +% { CTLuse_article_number +% yes.no.to.int +% 'is.use.number.for.article := +% } +% if$ +% CTLuse_paper +% empty$ +% { skip$ } +% { CTLuse_paper +% yes.no.to.int +% 'is.use.paper := +% } +% if$ +% CTLuse_forced_etal +% empty$ +% { skip$ } +% { CTLuse_forced_etal +% yes.no.to.int +% 'is.forced.et.al := +% } +% if$ + % 显示作者数目 + CTLmax_names_forced_etal + empty$ + { skip$ } + { CTLmax_names_forced_etal + string.to.integer + 'max.num.names.before.forced.et.al := + } + if$ + % 论文作者英文姓名 + CTLauthor_name_english + empty$ + { skip$ } + { CTLauthor_name_english + 'author.name.in.english := + % #1 'is.for.peer.review := +% "CTLauthor_name_english=" author.name.in.english * debug.output + } + if$ + % 论文作者中文姓名 + CTLauthor_name_chinese + empty$ + { skip$ } + { CTLauthor_name_chinese + 'author.name.in.chinese := + % #1 'is.for.peer.review := +% "CTLauthor_name_chinese=" author.name.in.chinese * debug.output + } + if$ + CTLfor_peer_review + empty$ + { skip$ } + { CTLfor_peer_review + yes.no.to.int + 'is.for.peer.review := + } + if$ +% CTLnames_show_etal +% empty$ +% { skip$ } +% { CTLnames_show_etal +% string.to.integer +% 'num.names.shown.with.forced.et.al := +% } +% if$ +% CTLuse_alt_spacing +% empty$ +% { skip$ } +% { CTLuse_alt_spacing +% yes.no.to.int +% 'is.use.alt.interword.spacing := +% } +% if$ +% CTLalt_stretch_factor +% empty$ +% { skip$ } +% { CTLalt_stretch_factor +% 'ALTinterwordstretchfactor := +% "\renewcommand{\BIBentryALTinterwordstretchfactor}{" +% ALTinterwordstretchfactor * "}" * +% write$ newline$ +% } +% if$ +% CTLdash_repeated_names +% empty$ +% { skip$ } +% { CTLdash_repeated_names +% yes.no.to.int +% 'is.dash.repeated.names := +% } +% if$ +% CTLname_emph_author_en % 强调显示的作者英文姓名 +% empty$ +% { skip$ } % 若没有给出则跳过 +% { CTLname_emph_author_en +% 'name.emph.author.en := % 否则更新 name.emph.author.en +% } +% if$ +% CTLname_emph_author_zh % 强调显示的作者中文姓名 +% empty$ +% { skip$ } % 若没有给出则跳过 +% { CTLname_emph_author_zh +% 'name.emph.author.zh := % 否则更新 name.emph.author.zh +% } +% if$ + CTLname_format_string % 英文姓名排版格式字符串 + empty$ + { skip$ } % 若没有自定义则跳过 + { CTLname_format_string % 否则更新 name.format.string + 'name.format.string := + } + if$ +% CTLname_latex_cmd +% empty$ +% { skip$ } +% { CTLname_latex_cmd +% 'name.latex.cmd := +% } +% if$ +% CTLname_url_prefix +% missing$ +% { skip$ } +% { CTLname_url_prefix +% 'name.url.prefix := +% } +% if$ + + +% num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > +% { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ +% max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := +% } +% { skip$ } +% if$ +} + +%%%%%%%%%%%% +%% 条目别名 +%%%%%%%%%%%% +%FUNCTION {phdthesis} {thesis} +%FUNCTION {masterthesis} {thesis} +FUNCTION {conference} {inproceedings} +FUNCTION {online} {electronic} +FUNCTION {internet} {electronic} +FUNCTION {webpage} {electronic} +FUNCTION {www} {electronic} +FUNCTION {default.type} {misc} + + +%%%%%%%%%% +%% 主程序 +%%%%%%%%%% + +READ + +EXECUTE {initialize.controls} % 初始化控制变量 +EXECUTE {initialize.status.constants} % 初始化状态常量 +EXECUTE {banner.message} % 显示初始提示信息 + +EXECUTE {initialize.longest.label} % 初始化最长的标号 +ITERATE {longest.label.pass} % 处理最长的标号 + +EXECUTE {begin.bib} % 开始 +ITERATE {call.type$} % +EXECUTE {end.bib} % 结束 + +EXECUTE {completed.message} % 显示完成提示信息 + +%% EOF diff --git a/Proposal/BUPTBachelorProposal.cls b/Proposal/BUPTBachelorProposal.cls new file mode 100644 index 0000000..0540255 --- /dev/null +++ b/Proposal/BUPTBachelorProposal.cls @@ -0,0 +1,60 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{BUPTBachelorProposal}[2014/08/16 Example LaTeX class] +\PassOptionsToPackage{AutoFakeBold}{xeCJK} +\PassOptionsToPackage{no-math}{fontspec} +\LoadClass[a4paper,fontset=windows,zihao=-4]{ctexart} + +\RequirePackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,headheight=1.5cm,headsep=0.6cm,footskip=0.5cm]{geometry} + + +\RequirePackage{fancyhdr} +\fancyhf{} +\renewcommand{\headrulewidth}{0pt} +\cfoot{\zihao{-5} -\ \thepage\ -} +\pagestyle{fancyplain} + +\RequirePackage{amssymb} +\RequirePackage{xstring} +\RequirePackage{enumitem} +\RequirePackage{url} +\RequirePackage[super,numbers,sort&compress]{natbib} +%\usepackage[backend=biber,texencoding=utf8,bibencoding=utf8]{biblatex} +\renewcommand{\refname}{\vspace{-1cm}} +%\renewcommand{\citet}[1]{\textsuperscript{\cite{#1}}} +\setcitestyle{square} +\bibliographystyle{BUPTBachelor} +\setlength{\bibsep}{0.2em} + +\usepackage{tabularray} +\DefTblrTemplate{middlehead,lasthead}{default}{} +\DefTblrTemplate{firstfoot,middlefoot}{default}{} + +\setmainfont{Times New Roman} + +\newcommand{\make@bupt@title}{ + \begin{center} + % 大标题宽度 + \newlength{\chstitle@titlewidth} + \settowidth{\chstitle@titlewidth}{\bfseries\songti\zihao{-3} 北京邮电大学} + \makebox[1.41667\chstitle@titlewidth][s]{\bfseries\songti\zihao{-3} 北京邮电大学} \par + \vspace{0.5cm} + + % 小标题宽度 + \newlength{\chstitle@subtitlewidth} + \settowidth{\chstitle@subtitlewidth}{\bfseries\songti\zihao{-3} 本科毕业设计(论文)开题报告} + \makebox[\chstitle@subtitlewidth][s]{\bfseries\songti\zihao{-3} 本科毕业设计(论文)开题报告} \par + \end{center} +} + +\def\@maketitle{ + \make@bupt@title +} + +\usepackage{titlesec} +\titlespacing{\section}{0pt}{0pt}{4pt} +\titleformat{\section}{\heiti\zihao{4}\bfseries}{\thesection}{1em}{} +\titleformat{\subsection}{\heiti\zihao{-4}\bfseries}{\qquad{}\thesubsection}{1em}{} +\titleformat{\subsubsection}{\heiti\zihao{-4}\bfseries}{\qquad{}\thesubsubsection}{1em}{} + +\RequirePackage{graphicx} +\RequirePackage{float} \ No newline at end of file diff --git a/Proposal/assets/signature.png b/Proposal/assets/signature.png new file mode 100644 index 0000000..ae44b4e Binary files /dev/null and b/Proposal/assets/signature.png differ diff --git a/Proposal/main.tex b/Proposal/main.tex new file mode 100644 index 0000000..cddc80f --- /dev/null +++ b/Proposal/main.tex @@ -0,0 +1,51 @@ +\documentclass{BUPTBachelorProposal} + +\begin{document} + +\maketitle + +\songti\zihao{5} + +\begin{longtblr}[ + label=none, + entry=none +]{|X[c, m]|X[c, m]|X[c, m]|X[c, m]|X[c, m]|X[c, m]|} + \hline + 学院 & \SetCell[c=2]{c} 计算机学院(国家示范性软件学院) && 专业 & \SetCell[c=2]{c} 计算机科学与技术 & \\ + \hline + 学生姓名 & xxx & 学号 & xxxxxxxxxx & 班级 & xxxxxxxxxx \\ + \hline + 指导教师姓名 & xxx & 所在单位 & 计算机学院(国家示范性软件学院) & 职称 & 副教授 \\ + \hline + \SetCell[r=2]{c} 设计(论文)题目 & \SetCell[c=5]{l} (中文) 一种异构并行编程模型的设计与实现 &&&& \\ + \hline + & \SetCell[c=5]{l} (英文)Design and Implementation of a Heterogeneous Programming Model &&&& \\ + \hline + \SetCell[c=6]{c} + \begin{minipage}[t]{\linewidth} + \setlength{\parindent}{2em} + \linespread{1.5} + + \setcounter{section}{0} + \end{minipage} &&&&& \\ + \hline + \SetCell[c=6]{c} + \begin{minipage}[t]{\linewidth} + \setlength{\parindent}{2em} + \linespread{1.5} + \setcounter{section}{4} + + \section{主要参考文献} + + \bibliography{ref} + \end{minipage} &&&&& \\ + \hline + \SetCell[c=3]{c} 允许进入毕业设计(论文)下一阶段:是 \mbox{\ooalign{$\checkmark$\cr\hidewidth$\square$\hidewidth\cr}} 否 $\square$ &&& \SetCell[r=2,c=1]{c} 指导教师签字 & \SetCell[r=2,c=2]{l} \includegraphics[height=26pt]{assets/signature.png} &\\ + \hline + 日期 & \SetCell[c=2]{c} 2024年x月x日 &&&&\\ + \hline + +\end{longtblr} + +\end{document} + diff --git a/Proposal/ref.bib b/Proposal/ref.bib new file mode 100644 index 0000000..2fa8da6 --- /dev/null +++ b/Proposal/ref.bib @@ -0,0 +1,206 @@ +@article{liu_heterogeneous_2014, + title = {异构并行编程模型研究与进展}, + volume = {25}, + issn = {1000-9825}, + doi = {10.13328/j.cnki.jos.004608}, + abstract = {近年来,异构系统硬件飞速发展.为了解决相应的编程和执行效率问题,异构并行编程模型已被广泛使用和研究.从异构并行编程接口与编译/运行时支持系统两个角度总结了异构并行编程模型最新的研究成果,它们为异构架构和上层应用带来的技术挑战提供了相应的解决方案.最后,结合目前的研究现状以及异构系统的发展,提出了异构并行编程模型的未来方向.}, + language = {en-US}, + number = {7}, + journal = {软件学报}, + author = {刘, 颖 and 吕, 方 and 王, 蕾 and 陈, 莉 and 崔, 慧敏 and 冯, 晓兵}, + year = {2014}, + keywords = {GPU, 异构并行编程模型, 异构系统, 编程接口, 编译, 运行时系统}, + pages = {1459--1475}, +} + +@www{ai-and-compute, + author = "OpenAI", + title = "AI and compute", + howpublished = "Website", + year = {2018}, + note = {\url{https://openai.com/index/ai-and-compute/}} +} + + +@inproceedings{auerbach_compiler_2012, + address = {San Francisco California}, + title = {A compiler and runtime for heterogeneous computing}, + isbn = {978-1-4503-1199-1}, + doi = {10.1145/2228360.2228411}, + abstract = {Heterogeneous systems show a lot of promise for extracting highperformance by combining the benefits of conventional architectures with specialized accelerators in the form of graphics processors (GPUs) and reconfigurable hardware (FPGAs). Extracting this performance often entails programming in disparate languages and models, making it hard for a programmer to work equally well on all aspects of an application. Further, relatively little attention is paid to co-execution—the problem of orchestrating program execution using multiple distinct computational elements that work seamlessly together.}, + urldate = {2024-07-16}, + booktitle = {Proceedings of the 49th {Annual} {Design} {Automation} {Conference}}, + publisher = {ACM}, + author = {Auerbach, Joshua and Bacon, David F. and Burcea, Ioana and Cheng, Perry and Fink, Stephen J. and Rabbah, Rodric and Shukla, Sunil}, + month = jun, + year = {2012}, + pages = {271--276}, +} + + +@article{perez_user-driven_2023, + title = {User-driven {Online} {Kernel} {Fusion} for {SYCL}}, + volume = {20}, + issn = {1544-3566, 1544-3973}, + url = {https://dl.acm.org/doi/10.1145/3571284}, + doi = {10.1145/3571284}, + abstract = {Heterogeneous programming models are becoming increasingly popular to support the ever-evolving hardware architectures, especially for new and emerging specialized accelerators optimizing specific tasks. While such programs provide performance portability of the existing applications across various heterogeneous architectures to some extent, short-running device kernels can affect an application performance due to overheads of data transfer, synchronization, and kernel launch. While in applications with one or two short-running kernels the overhead can be negligible, it can be noticeable when these short-running kernels dominate the overall number of kernels in an application, as it is the case in graph-based neural network models, where there are several small memory-bound nodes alongside few large compute-bound nodes. + + To reduce the overhead, combining several kernels into a single, more optimized kernel is an active area of research. However, this task can be time-consuming and error-prone given the huge set of potential combinations. This can push programmers to seek a tradeoff between (a) task-specific kernels with low overhead but hard to maintain and (b) smaller modular kernels with higher overhead but easier to maintain. While there are DSL-based approaches, such as those provided for machine learning frameworks, which offer the possibility of such a fusion, they are limited to a particular domain and exploit specific knowledge of that domain and, as a consequence, are hard to port elsewhere. This study explores the feasibility of a user-driven + kernel fusion + through an extension to the SYCL API to address the automation of kernel fusion. The proposed solution requires programmers to define the subgraph regions that are potentially suitable for fusion without any modification to the kernel code or the function signature. We evaluate the performance benefit of our approach on common neural networks and study the performance improvement in detail.}, + number = {2}, + urldate = {2024-10-29}, + journal = {ACM Transactions on Architecture and Code Optimization}, + author = {Pérez, Víctor and Sommer, Lukas and Lomüller, Victor and Narasimhan, Kumudha and Goli, Mehdi}, + month = jun, + year = {2023}, + pages = {1--25}, +} + + +@inproceedings{tiotto_experiences_2024, + address = {Edinburgh, United Kingdom}, + title = {Experiences {Building} an {MLIR}-{Based} {SYCL} {Compiler}}, + copyright = {https://doi.org/10.15223/policy-029}, + isbn = {9798350395099}, + url = {https://ieeexplore.ieee.org/document/10444866/}, + doi = {10.1109/CGO57630.2024.10444866}, + abstract = {Similar to other programming models, compilers for SYCL, the open programming model for heterogeneous computing based on C++, would benefit from access to higher-level intermediate representations. The loss of high-level structure and semantics caused by premature lowering to low-level intermediate representations and the inability to reason about host and device code simultaneously present major challenges for SYCL compilers. The MLIR compiler framework, through its dialect mechanism, allows to model domain-specific, high-level intermediate representations and provides the necessary facilities to address these challenges.}, + urldate = {2024-10-29}, + booktitle = {2024 {IEEE}/{ACM} {International} {Symposium} on {Code} {Generation} and {Optimization} ({CGO})}, + publisher = {IEEE}, + author = {Tiotto, Ettore and Pérez, Víctor and Tsang, Whitney and Sommer, Lukas and Oppermann, Julian and Lomüller, Victor and Goli, Mehdi and Brodman, James}, + month = mar, + year = {2024}, + pages = {399--410}, +} + +@article{a_lime_a_2010, + author = {Auerbach, Joshua and Bacon, David F. and Cheng, Perry and Rabbah, Rodric}, + title = {Lime: a Java-compatible and synthesizable language for heterogeneous architectures}, + year = {2010}, + issue_date = {October 2010}, + publisher = {Association for Computing Machinery}, + address = {New York, NY, USA}, + volume = {45}, + number = {10}, + issn = {0362-1340}, + url = {https://doi.org/10.1145/1932682.1869469}, + doi = {10.1145/1932682.1869469}, + abstract = {The halt in clock frequency scaling has forced architects and language designers to look elsewhere for continued improvements in performance. We believe that extracting maximum performance will require compilation to highly heterogeneous architectures that include reconfigurable hardware.We present a new language, Lime, which is designed to be executable across a broad range of architectures, from FPGAs to conventional CPUs. We present the language as a whole, focusing on its novel features for limiting side-effects and integration of the streaming paradigm into an object- oriented language. We conclude with some initial results demonstrating applications running either on a CPU or co- executing on a CPU and an FPGA.}, + journal = {SIGPLAN Not.}, + month = oct, + pages = {89–108}, + numpages = {20}, + keywords = {value type, streaming, reconfigurable architecture, object oriented, high level synthesis, functional programming, fpga} +} + + +@inproceedings{lattner_mlir_2021, + address = {Seoul, Korea (South)}, + title = {{MLIR}: {Scaling} {Compiler} {Infrastructure} for {Domain} {Specific} {Computation}}, + copyright = {https://ieeexplore.ieee.org/Xplorehelp/downloads/license-information/IEEE.html}, + isbn = {978-1-72818-613-9}, + shorttitle = {{MLIR}}, + url = {https://ieeexplore.ieee.org/document/9370308/}, + doi = {10.1109/CGO51591.2021.9370308}, + abstract = {This work presents MLIR, a novel approach to building reusable and extensible compiler infrastructure. MLIR addresses software fragmentation, compilation for heterogeneous hardware, significantly reducing the cost of building domain specific compilers, and connecting existing compilers together.}, + urldate = {2024-11-05}, + booktitle = {2021 {IEEE}/{ACM} {International} {Symposium} on {Code} {Generation} and {Optimization} ({CGO})}, + publisher = {IEEE}, + author = {Lattner, Chris and Amini, Mehdi and Bondhugula, Uday and Cohen, Albert and Davis, Andy and Pienaar, Jacques and Riddle, River and Shpeisman, Tatiana and Vasilache, Nicolas and Zinenko, Oleksandr}, + month = feb, + year = {2021}, + pages = {2--14}, + file = {PDF:/home/ricardo/Zotero/storage/C26LLMFA/Lattner et al. - 2021 - MLIR Scaling Compiler Infrastructure for Domain Specific Computation.pdf:application/pdf}, +} + + +@incollection{malawski_sycl-bench_2020, + address = {Cham}, + title = {{SYCL}-{Bench}: {A} {Versatile} {Cross}-{Platform} {Benchmark} {Suite} for {Heterogeneous} {Computing}}, + volume = {12247}, + isbn = {978-3-030-57674-5 978-3-030-57675-2}, + shorttitle = {{SYCL}-{Bench}}, + url = {https://link.springer.com/10.1007/978-3-030-57675-2_39}, + abstract = {The SYCL standard promises to enable high productivity in heterogeneous programming of a broad range of parallel devices, including multicore CPUs, GPUs, and FPGAs. Its modern and expressive C++ API design, as well as flexible task graph execution model give rise to ample optimization opportunities at run-time, such as the overlapping of data transfers and kernel execution. However, it is not clear which of the existing SYCL implementations perform such scheduling optimizations, and to what extent. Furthermore, SYCL’s high level of abstraction may raise concerns about sacrificing performance for ease of use. Benchmarks are required to accurately assess the performance behavior of high-level programming models such as SYCL. To this end, we present SYCLBench, a versatile benchmark suite for device characterization and runtime benchmarking, written in SYCL. We experimentally demonstrate the effectiveness of SYCL-Bench by performing device characterization of the NVIDIA TITAN X GPU, and by evaluating the efficiency of the hipSYCL and ComputeCpp SYCL implementations.}, + urldate = {2024-11-11}, + booktitle = {Euro-{Par} 2020: {Parallel} {Processing}}, + publisher = {Springer International Publishing}, + author = {Lal, Sohan and Alpay, Aksel and Salzmann, Philip and Cosenza, Biagio and Hirsch, Alexander and Stawinoga, Nicolai and Thoman, Peter and Fahringer, Thomas and Heuveline, Vincent}, + editor = {Malawski, Maciej and Rzadca, Krzysztof}, + year = {2020}, + doi = {10.1007/978-3-030-57675-2_39}, + note = {Series Title: Lecture Notes in Computer Science}, + pages = {629--644}, + file = {PDF:/home/ricardo/Zotero/storage/7YQEHBJJ/Lal et al. - 2020 - SYCL-Bench A Versatile Cross-Platform Benchmark Suite for Heterogeneous Computing.pdf:application/pdf}, +} + + +@article{wu_heterogeneous_2021, + title = {异构计算并行编程模型综述}, + volume = {38}, + issn = {2096-8655}, + doi = {10.19328/j.cnki.2096-8655.2021.04.001}, + abstract = {异构计算架构是目前高性能计算研究的重要领域。在异构计算架构中,不同种类的计算器件协同工作需要解决如任务调度、数据通信、存储、同步优化等问题。这些问题会对异构计算架构系统的运行性能、功耗、可靠性等指标产生重要影响。为解决异构系统的应用开发与系统优化问题,近年出现许多面向异构计算架构的并行编程模型。本文介绍异构并行编程模型的研究进展,针对异构并行计算需要解决的关键问题进行讨论,最后对异构体系架构的发展方向做出总结。}, + language = {zh}, + number = {4}, + journal = {上海航天(中英文)}, + author = {邬, 江兴 and 祁, 晓峰 and 高, 彦钊}, + year = {2021}, + keywords = {中间表示, 任务调度, 并行编程, 异构计算, 编程模型, 负载均衡}, + pages = {1--11}, +} + + +@article{ju_optimization_2015, + title = {异构众核系统及其编程模型与性能优化技术研究综述}, + volume = {43}, + issn = {0372-2112}, + abstract = {异构众核系统已成为当前高性能计算领域重要的发展趋势.针对异构众核系统,从架构、编程、所支持的应用三方面分析对比当前不同异构系统的特点,揭示了异构系统的发展趋势及异构系统相对于传统多核并行系统的优势;然后从编程模型和性能优化方面分析了异构系统存在的问题和面临的挑战,以及国内外研究现状,结合当前研究存在的问题和难点,探讨了该领域进一步深入的研究方向;同时对两种典型的异构众核系统CPU+GPU和CPU+MIC进行不同应用类型的Benchmark测试,验证了两种异构系统不同的应用特点,为用户选择具体异构系统提供参考,在此基础上提出将两种众核处理器(GPU和MIC)结合在一个计算节点内构成新型混合异构系统;该新型混合异构系统可以利用两种众核处理器不同的处理优势,协同处理具有不同应用特点的复杂应用,同时分析了在该混合异构系统下必须要研究和解决的关键问题;最后对异构众核系统面临的挑战和进一步的研究方向进行了总结和展望.}, + language = {zh}, + number = {1}, + journal = {电子学报}, + author = {巨, 涛 and 朱, 正东 and 董, 小社}, + year = {2015}, + keywords = {异构众核系统, 异构计算, 性能优化, 编程模型, 高性能计算}, + pages = {111--119}, +} + + +@article{wu_uppa_2020, + title = {{UPPA}:面向异构众核系统的统一并行编程架构}, + volume = {43}, + issn = {0254-4164}, + abstract = {主流异构并行编程方法如CUDA和OpenCL,其编程抽象层次低,编程接口靠近底层,无法为用户屏蔽底层硬件和运行时细节,导致编程逻辑复杂,编程困难易错.同时应用性能绑定于底层运行时环境,在硬件架构变化时需要根据硬件特征进行针对性改动和优化,无法保证上层应用的统一.为了简化异构并行编程,提高编程效率,实现上层应用的统一和跨平台,本文提出了一种面向异构众核系统的高层统一并行编程架构UPPA(Unified Parallel Programming Architecture).架构中首先提出了数据关联计算编程模型,实现了不同层级不同模式并行性的统一描述,简化了异构并行编程逻辑,提供了高层统一的并行编程抽象;继而设计了数据关联计算描述语言为用户提供简便易用的统一编程接口,通过高层语义结构保留了应用的并行特征,可以指导编译和运行时系统实现向不同硬件架构的自动映射,保证了上层应用的统一,并采用C语言兼容的语法提供针对高层语义结构的语言扩展,保证编程接口的易学易用;最后提供了基于OpenCL的编译和运行时原型系统,以OpenCL为中间语言实现了高层应用在不同异构系统上的执行,提供了良好的跨平台特性.我们使用数据关联计算描述语言对Parboil和Rodinia测试集中的多个测试用例进行了重构,并在NVIDIA GPU和Intel MIC两种异构平台上进行了验证测试.每个测试用例重构的代码量与测试集提供的串行代码相当,仅为测试集OpenCL代码的13\%~64\%,有效地降低了异构编程的工作量.在编译和运行时系统的支持下,重构代码无需改动就可以在两种平台上执行.相比于人工编写且经过优化的测试集OpenCL代码,重构代码在GPU和MIC两种平台下分别能够达到其性能的91\%~100\%和76\%~98\%,这表明了本文方法的有效性和编译与运行时系统的高效.}, + language = {zh}, + number = {6}, + journal = {计算机学报}, + author = {吴, 树森 and 董, 小社 and 王, 宇菲 and 王, 龙翔 and 朱, 正东}, + year = {2020}, + keywords = {OpenCL, 并行编程模型, 异构并行编程, 数据关联计算, 统一编程架构}, + pages = {990--1009}, +} + + +@article{cai_coala_2024, + title = {{COALA}: {A} {Compiler}-{Assisted} {Adaptive} {Library} {Routines} {Allocation} {Framework} for {Heterogeneous} {Systems}}, + volume = {73}, + copyright = {https://ieeexplore.ieee.org/Xplorehelp/downloads/license-information/IEEE.html}, + issn = {0018-9340, 1557-9956, 2326-3814}, + shorttitle = {{COALA}}, + url = {https://ieeexplore.ieee.org/document/10495065/}, + doi = {10.1109/TC.2024.3385269}, + number = {7}, + urldate = {2024-10-14}, + journal = {IEEE Transactions on Computers}, + author = {Cai, Qinyun and Tan, Guanghua and Yang, Wangdong and He, Xianhao and Yan, Yuwei and Li, Keqin and Li, Kenli}, + month = jul, + year = {2024}, + pages = {1724--1737}, + file = {PDF:/home/ricardo/Zotero/storage/LVBVKYIS/Cai et al. - 2024 - COALA A Compiler-Assisted Adaptive Library Routines Allocation Framework for Heterogeneous Systems.pdf:application/pdf}, +} + + +