/articles/toma

To get this branch, use:
bzr branch http://darksoft.org/webbzr/articles/toma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
%Fixing line spacing in algorithm captions
\makeatletter
\patchcmd{\algocf@latexcaption}{#3}{#3\endgraf}{}{}
\makeatother

%Configure Algorithm
\SetAlFnt{\footnotesize}
%\newcommand{\xAlCapSty}[1]{\small\sffamily\bfseries\MakeUppercase{#1}}
%\SetAlCapSty{xAlCapSty}
\newcommand{\xAlCapSty}[1]{#1}
\SetAlCapSty{xAlCapSty}
\SetAlCapSkip{0.5em}
\SetAlCapFnt{\footnotesize}
\SetAlCapNameFnt{\footnotesize}
%\SetAlCapSkip{1em}

%\newcommand{\xCommentSty}[1]{\scriptsize\ttfamily\textcolor{blue}{#1}}
%\newcommand{\xCommentSty}[1]{\footnotesize\ttfamily\textcolor{darkgray}{#1}}
\newcommand{\xCommentSty}[1]{\scriptsize\ttfamily\textcolor{darkgray}{#1}}
\SetCommentSty{xCommentSty}
\SetSideCommentRight
\DontPrintSemicolon


%Special Keywords
\SetKw{KwBy}{by}
\SetKw{KwSync}{\hrulefill~sync~\hrulefill}
\SetKw{KwSyncThreads}{\hrulefill~syncthreads~\hrulefill}
\SetKw{KwFence}{\hrulefill~fence~\hrulefill}

\SetKwFor{For}{for}{}{end}
\SetKwBlock{KwDots}{...}{...}

\SetFuncSty{textbf}
\SetKwFunction{KwTex}{tex2d}

\newcommand{\shfl}[1]{shfl\_#1}
\SetKwFunction{KwShflXor}{\shfl{xor}}
\SetKwFunction{KwShflDown}{\shfl{down}}
\SetKwFunction{KwFloor}{floor}


\SetKwInput{KwShMem}{Shared}
\SetKwInput{KwAssume}{Assume}
%\SetKw{KwShMem}{Shared}



%Math
%\newcommand{\eq}{\leftarrow}
%\newcommand{\ifeq}{==}
%\newcommand{\vmul}{\mathbin{\circ}}
%\newcommand{\mul}{\mathbin{\bullet}} %circ, bullet, times, cdot
%\newcommand{\idiv}{\mathbin{\backslash}}
%\newcommand{\fconst}[1]{#1f}

\newcommand{\eq}{=}
\newcommand{\ifeq}{==}
\newcommand{\vmul}{\mathbin{*}}
\newcommand{\mul}{\mathbin{*}}
\newcommand{\idiv}{\mathbin{/}}
\newcommand{\imod}{\mathbin{\%}}
\newcommand{\aeq}{\mathrel{+}=}
\newcommand{\seq}{\mathrel{-}=}
\newcommand{\meq}{\mathrel{\mul}=}
\newcommand{\deq}{\mathrel{\idiv}=}
\newcommand{\fconst}[1]{#1}
\newcommand{\fconstf}[1]{#1f}
\newcommand{\vfloat}[1]{\tilde{#1}}
\newcommand{\vdata}[1]{\vec{#1}}
\newcommand{\vx}[1]{#1.x}
\newcommand{\vy}[1]{#1.y}
\newcommand{\vz}[1]{#1.z}
\newcommand{\vw}[1]{#1.w}
\newcommand{\vlist}[1]{\{#1\}}

\newcommand{\shmem}[1]{#1^S}
\newcommand{\cmem}[1]{#1^C}
\newcommand{\gmem}[1]{#1^G}
%\newcommand{\shmem}[1]{#1^{\encircled{S}}}
%\newcommand{\cmem}[1]{#1^{\encircled{C}}}
%\newcommand{\gmem}[1]{#1^{\encircled{G}}}


%mapping variants
%\newcommand{\ver}[2]{#2^{#1}}
\newcommand{\ver}[2]{#2^{\encircled{#1}}}

\newcommand{\cast}[2]{\textbf{*(#1)}\textbf{(}\textbf{\&}#2\textbf{)}}



%\newcommand{\ForTo}[4]{\For{$#1 \eq #2$ \KwTo #3}{#4}}
\newcommand{\ForTo}[4]{\For{($#1 \eq #2$; $#1 < #3$; $#1 \mathrel{+}= 1$)}{#4}}
%\newcommand{\ForToBy}[5]{\For{$#1 \eq #2$ \KwTo #3 \KwBy #4}{#5}}
\newcommand{\ForToBy}[5]{\For{($#1 \eq #2$; $#1 < #3$; $#1 \mathrel{+}= #4$)}{#5}}
\newcommand{\CFor}[4]{\For{($#1$; $#2$; $#3$)}{#4}}