唔最近各种忙死了啊wwwwwww

于是作为调剂,弄了一套BOSE Companion 20到研究室去,听音乐的音质好一点干事都要心情顺畅一点~当然了,研究室里面有其他人的时候开音箱只是噪音扰民,所以有人的时候都是把音箱当放大器接耳机听,而到了晚上没其他人一个人霸占研究室的时候就可以心安理得地开音箱了XD
IMG_2363

然后虽然当初订电脑的时候并没有订触控板,8过教授突然问有没有人想要触控板的——于是作为键盘鼠标触控板三刀流的咱自然举手了——用触控板玩Mission Control的快感,乃们这些Windows党自然不会懂(殴),于是教授把他原来那块触控板那给偶,自己订了一台新的27寸iMac再弄了一块触控板过来wwwwww
IMG_2365

话说最近在研究室方面最大的成就就是成功搞定了Bitonic Sort——一个用于并行计算的排序方式w大家知道排序通常像CPU这样的单线程排序的话算法很好解决,而且现在已经有很多种算法了;但问题是那些算法都并不适合用在GPU这样的并行计算上,所以为了能让GPU更快地排序咱是查了好多的资料甚至想过直接引用Library,8过最后还是将目光锁定在了这个Bitonic Sort的排序算法上——有兴趣的童鞋欢迎围观wiki上的说明(英文),嘛光是为了搞懂这货到底是怎么运作的咱就花了两天的时间,然后又花了两天的时间才最终把代码写出来ww这货真麻烦w有兴趣的童鞋欢迎围观下面的代码(语言为CUDA,每个Block使用1024个Thread排序4096个项目,其中R是项目值,R_posX和R_posY则分别是该值的X坐标和Y坐标;正如同上篇文章所说代码内大量试用了bit运算符和特别是shift运算符),当然如果你有更快的解决办法也欢迎提出来哦~(顺便一说——其实上面的照片里面iMac下面的那张草稿纸正是关于这个Bitonic Sort的草稿,当然这只是其中一张而已w)

01
02
03
04
05
06
07
08
09
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
<span class="pln">__device__ </span><span class="kwd">void</span><span class="pln"> bitonicSort</span><span class="pun">(</span><span class="kwd">float</span><span class="pln"> </span><span class="pun">*</span><span class="pln">R</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">char</span><span class="pln"> </span><span class="pun">*</span><span class="pln">R_posX</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">char</span><span class="pln"> </span><span class="pun">*</span><span class="pln">R_posY</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
     
    </span><span class="kwd">int</span><span class="pln"> i</span><span class="pun">,</span><span class="pln"> j</span><span class="pun">,</span><span class="pln"> k</span><span class="pun">,</span><span class="pln"> frac</span><span class="pun">,</span><span class="pln"> xtemp</span><span class="pun">,</span><span class="pln"> x</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">group</span><span class="pun">,</span><span class="pln"> el0</span><span class="pun">,</span><span class="pln"> el1</span><span class="pun">;</span><span class="pln">
    </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="pln">i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> </span><span class="lit">1</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> i </span><span class="pun"><=</span><span class="pln"> </span><span class="lit">2048</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
        </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="pln">j </span><span class="pun">=</span><span class="pln"> i</span><span class="pun">;</span><span class="pln"> j </span><span class="pun">>=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> j</span><span class="pun">--)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             
            </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">j </span><span class="pun">==</span><span class="pln"> i</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="pln">k </span><span class="pun">=</span><span class="pln"> threadIdx</span><span class="pun">.</span><span class="pln">y </span><span class="pun">*</span><span class="pln"> blockDim</span><span class="pun">.</span><span class="pln">x </span><span class="pun">+</span><span class="pln"> threadIdx</span><span class="pun">.</span><span class="pln">x</span><span class="pun">;</span><span class="pln"> k </span><span class="pun"><</span><span class="pln"> </span><span class="lit">2048</span><span class="pun">;</span><span class="pln"> k </span><span class="pun">+=</span><span class="pln"> blockDim</span><span class="pun">.</span><span class="pln">x </span><span class="pun">*</span><span class="pln"> blockDim</span><span class="pun">.</span><span class="pln">y</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                    frac </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="lit">1</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> </span><span class="pun">(</span><span class="pln">j </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">))</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> </span><span class="lit">1</span><span class="pun">;</span><span class="pln">
                    xtemp </span><span class="pun">=</span><span class="pln"> k </span><span class="pun">>></span><span class="pln"> j</span><span class="pun">;</span><span class="pln">
                    x </span><span class="pun">=</span><span class="pln"> xtemp </span><span class="pun"><<</span><span class="pln"> j</span><span class="pun">;</span><span class="pln">
                     
                    </span><span class="kwd">group</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x </span><span class="pun"><<</span><span class="pln"> </span><span class="lit">2</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> frac</span><span class="pun">;</span><span class="pln">
                    el0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x </span><span class="pun"><<</span><span class="pln"> </span><span class="lit">1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">k </span><span class="pun">&</span><span class="pln"> </span><span class="pun">((</span><span class="lit">1</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> j</span><span class="pun">)</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
                    el1 </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">group</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> el0</span><span class="pun">;</span><span class="pln">
                     
                    </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">R</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">]</span><span class="pln"> </span><span class="pun"><</span><span class="pln"> R</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">])</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                        swapFloat</span><span class="pun">(&</span><span class="pln">R</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">],</span><span class="pln"> </span><span class="pun">&</span><span class="pln">R</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">]);</span><span class="pln">
                        swapChar</span><span class="pun">(&</span><span class="pln">R_posX</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">],</span><span class="pln"> </span><span class="pun">&</span><span class="pln">R_posX</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">]);</span><span class="pln">
                        swapChar</span><span class="pun">(&</span><span class="pln">R_posY</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">],</span><span class="pln"> </span><span class="pun">&</span><span class="pln">R_posY</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">]);</span><span class="pln">
                    </span><span class="pun">}</span><span class="pln">
                </span><span class="pun">}</span><span class="pln">
                 
            </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="pln">k </span><span class="pun">=</span><span class="pln"> threadIdx</span><span class="pun">.</span><span class="pln">y </span><span class="pun">*</span><span class="pln"> blockDim</span><span class="pun">.</span><span class="pln">x </span><span class="pun">+</span><span class="pln"> threadIdx</span><span class="pun">.</span><span class="pln">x</span><span class="pun">;</span><span class="pln"> k </span><span class="pun"><</span><span class="pln"> </span><span class="lit">2048</span><span class="pun">;</span><span class="pln"> k </span><span class="pun">+=</span><span class="pln"> blockDim</span><span class="pun">.</span><span class="pln">x </span><span class="pun">*</span><span class="pln"> blockDim</span><span class="pun">.</span><span class="pln">y</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                    xtemp </span><span class="pun">=</span><span class="pln"> k </span><span class="pun">>></span><span class="pln"> j</span><span class="pun">;</span><span class="pln">
                    x </span><span class="pun">=</span><span class="pln"> xtemp </span><span class="pun"><<</span><span class="pln"> j</span><span class="pun">;</span><span class="pln">
                     
                    el0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x </span><span class="pun"><<</span><span class="pln"> </span><span class="lit">1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">k </span><span class="pun">&</span><span class="pln"> </span><span class="pun">((</span><span class="lit">1</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> j</span><span class="pun">)</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
                    el1 </span><span class="pun">=</span><span class="pln"> el0 </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="lit">1</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> j</span><span class="pun">);</span><span class="pln">
                     
                    </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">R</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">]</span><span class="pln"> </span><span class="pun"><</span><span class="pln"> R</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">])</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                        swapFloat</span><span class="pun">(&</span><span class="pln">R</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">],</span><span class="pln"> </span><span class="pun">&</span><span class="pln">R</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">]);</span><span class="pln">
                        swapChar</span><span class="pun">(&</span><span class="pln">R_posX</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">],</span><span class="pln"> </span><span class="pun">&</span><span class="pln">R_posX</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">]);</span><span class="pln">
                        swapChar</span><span class="pun">(&</span><span class="pln">R_posY</span><span class="pun">[</span><span class="pln">el0</span><span class="pun">],</span><span class="pln"> </span><span class="pun">&</span><span class="pln">R_posY</span><span class="pun">[</span><span class="pln">el1</span><span class="pun">]);</span><span class="pln">
                    </span><span class="pun">}</span><span class="pln">
                </span><span class="pun">}</span><span class="pln">
                 
            </span><span class="pun">}</span><span class="pln">
            __syncthreads</span><span class="pun">();</span><span class="pln">
             
        </span><span class="pun">}</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
     
</span><span class="pun">}</span>

嘛Bitonic Sort解决了之后误差矢量的去除就解决了一半了,然后Sub Pixel精度也已经搞定了,于是差不多该动笔写毕业论文了w

好了研究室的事情就说到这里,话说公司附近有家中餐馆很不错的,量足味美,价格也不算特别贵——当然对于咱这种食量并不大的人来说还是更希望哪怕他量减半,只要价格也半价就好了w
IMG_2369

传说中的氷菓米,终于在Rakuten上订了哦!现在在东京有电饭煲终于可以自己煮饭了,可惜上一袋米还没吃完,等吃完了再来品尝吃蛋挞家种的岐阜飛騨高山产こしひかり大米w
IMG_2375

昨天星期六从东京回宇都宫的时候,本来是跟另外一个朋友约好见面的,结果那个朋友感冒还没好没法出门,然后另外又从国内来了两个朋友,而且居然正好和偶在东京的几个朋友又都在秋叶原,于是好吧很偶然的一群死宅们就这样聚在一起了——图为某WS大叔,阿不,是妹子(生理上)在秋叶原Gamers本店1楼对Supersonico的抱枕实施性侵犯,啊不,是亲密身体接触的瞬间w
IMG_2388

然后咱在とらのあな也正好看到了新发售的这货——毫不犹豫入手w
IMG_2390

以上,估计这样的繁忙日子还将继续持续一段时间w

p.s. 终于把研究室的iMac的桌面换掉了——女仆本的壁纸图集太大了而且有不少比iMac的分辨率要低的,所以懒得换图集了,干脆只换了一张单张——CiCi老师画的吃蛋挞
スクリーンショット 2012-12-12 9.11.13

再p.s. WordPress 3.5终于插入图片比原来方便点了……w

Author: 星野恵瑠

Mac user, Niji-Ota, Chinese, Now working in Japan at MAGES. Inc., Future's aim is that one day my name can be listed in Wikipedia

35 thoughts on “唔最近各种忙死了啊wwwwwww”

  1. 目测能抢个沙发- –
    话说啥时候能出个朱音想要的角色的带欧派的抱枕… 顺便最好不要是枕芯限定的那种… 再不出朱音都要毕业了…

  2. 有新iMac真好~ (=v=o)
    并行计算什么的…日常真心很少用上,以前xcode2~3的时候还能进行分布编译,到了4之后直接去掉了这功能,而且Lion之后也没Xgrid了。不过电脑性能高的话也没必要这些就是~ (^o^;)

  3. @星野恵瑠
    原来是指多线程啊… (……)
    嘛确实单线程的话超蛋疼的~ (=v=o) 不过多线程麻烦好多…
    就和同步异步那样,对于咱这种喜欢偷懒的人来说只要是不严重影响体验的情况一般是不会使用异步的…

  4. 刚连续在研究室呆了60个钟头的人也来蹭一脚。。(教授突发奇想,要咱们用东方角色制作宣传科学知识的动画。。。完全专业范围外于是各种效率低下啊啊啊。。稀里糊涂地通宵达旦着)
    BOSE什么的。。在研究室一直用着的音箱是buffalo> <。。。深更半夜在研究室听ラジオ算是能听个响

    ps.看见peko眼睛一亮+w+

  5. 话说我玩过wacom的触摸板在windows上面~~~
    我在Google阅读器看到了自动显示了最邪恶的那张图,谷歌果然合我口味23333

  6. 沉甸甸的手感想必很舒服吧,嘿嘿。这个墙纸真不错啊,又震撼,又不是太花哨,好想要个新显示器呀

  7. 我的壁纸现在是win7和win8的默认壁纸,实在是没兴趣换新的了。
    看来看去还是默认的舒服,这是肿么了。

  8. @Czzoo
    不至于吧 (!!!!)

    @Jacse
    嘛偶Windows上也是“近乎于”默认壁纸 (XD)

    @Leyeang
    不知道偶没去摸 (=v=o) 感觉已经被摸得太脏了

    @Decmes
    买不起+1好羡慕那些一天就预约4个游戏的壕夶啊 ( ̄‥ ̄)

    @Gulf Howe
    @TTkea
    这年头妹子比怪叔叔还怪叔叔 (:D)

    @kita
    女仆本上的话百合壁纸一大堆 (:D)

    @龙龙Fred
    Windows木有Mission Control根本木有太大意思啊 (……)

    @conanshang
    肯定会的 (:D)

    @SimpleMe
    peko大美啊 (o>v<o) 你们教授原来是东方厨么 (:D)

    @bi119aTe5hXk
    偶写的很清楚了1024个thread了吧 (!!!!)

Leave a Reply to conanshang Cancel reply

Your email address will not be published. Required fields are marked *

(;;) (:D) (!!!!) (……) (^o^;) (==) (OoO) (=v=o) more »Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).