/articles/toma

To get this branch, use:
bzr branch http://darksoft.org/webbzr/articles/toma

« back to all changes in this revision

Viewing changes to alg_texrec_pascal.tex

  • Committer: Suren A. Chilingaryan
  • Date: 2018-03-28 20:45:16 UTC
  • Revision ID: csa@suren.me-20180328204516-m8tul1u3uu4kd76z
transact: partially apply proofs by Evelina

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
\KwShMem {$\shmem{\vfloat{s}}[64][4]$, $\shmem{\vfloat{r}}[16][16]$}
7
7
\KwOut {Reconstructed slice $\gmem{\vfloat{r}}$}
8
8
\Begin {
9
 
\tcc{Compute the sequential number of 4x4 square, quadrant, and pixel within quadrant}
 
9
\tcc{Computing sequential numbers of 4x4 square, quadrant, and pixel within quadrant}
10
10
$square \eq \vy{m_t} \imod 4$ \;
11
11
$quadrant \eq \vx{m_t} \idiv 4$ \;
12
12
$pixel \eq \vx{m_t} \imod 4$ \;
13
13
 
14
 
\tcc{Compute the projection and  pixel offset}
 
14
\tcc{Computing projection and pixel offsets}
15
15
$m_p \eq \vy{m_t} \idiv 4$ \;
16
16
$\vx{m_t'} \eq 4 \mul square + 2 \mul (quadrant \imod 2) +  (pixel \imod 2) $ \;
17
17
$\vy{m_t'} \eq 2 \mul (quadrant \idiv 2) +  (pixel \idiv 2) $ \;
18
18
 
19
 
\tcc{Computing the pixel coordinates}
 
19
\tcc{Computing pixel coordinates}
20
20
$\vdata{m}'_g \eq \vdata{m}_b \vmul \vdata{n}_t + \vdata{m}'_t$ \;
21
21
$\vdata{f}'_g \eq \vdata{m}'_g - \vdata{v}_a$ \;
22
22
 
23
 
\tcc{Computing the partial sums}
 
23
\tcc{Computing partial sums}
24
24
$\vfloat{s}[4] \eq \{0\}$ \;
25
25
\ForToBy{p}{m_p}{n_p}{4}{
26
26
    $c_s \eq \vy{\cmem{c_s}[p]}$ \;
45
45
        $\vfloat{r} \aeq$ \KwShflXor{$\vfloat{r}$, $i$, $4$} \;   
46
46
    }
47
47
  
48
 
    \tcc{To coalesce global memory writes, the results are grouped in shared memory}
 
48
    \tcc{Grouping results in shared memory to coalesce global memory writes}
49
49
    \If{$\vx{m_t''} \ifeq 0$} {
50
50
        $\shmem{\vfloat{r}}[4 \mul q + \vy{m_t''} \idiv 16][\vy{m_t''} \imod 16] \eq\vfloat{r}$ \;
51
51
    }