annotate presen/presen.rst @ 24:de8ba175cc9b

add 比較
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Sat, 14 Feb 2009 23:45:47 +0900
parents 51c95851ae11
children 252d2d951d7e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
1 .. include:: s5defs.txt
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
2 .. include:: <mmlalias.txt>
20
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
3
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
4 ===========================================
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
5 Cell 用の Fine-Grain Task Manager の実装
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
6 ===========================================
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
7
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
8 *発表者*
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
9 **宮國渡**
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
10
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
11 *指導教官*
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
12 **河野真治**
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
13
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
14 *所属*
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
15 **琉球大学 理工学研究科 情報工学専攻 並列信頼研究室**
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
16
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
17
24
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
18 発表の流れ
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
19 ======================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
20
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
21 - 研究の背景と目的
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
22 - Cell アーキテクチャの概要
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
23 - Many Core プログラミングの特徴
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
24 - Task Manager の実装
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
25 - Task Manager を用いた並列プログラム
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
26 - Cerium
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
27 - Cerium を用いたゲーム
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
28 - まとめと今後の課題
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
29
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
30
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
31 研究の背景
20
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
32 ===================
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
33
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
34 現在、学生実験で PS3Linux を用いてゲーム開発を行っているが、
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
35 学生には困難であることがわかってきている
20
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
36
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
37 + :maroon:`問題1` : :underline:`Cell アーキテクチャプログラミング`
20
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
38
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
39 + Many Core による並列プログラミング
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
40
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
41 (データ、コードの分割の必要性)
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
42
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
43 + Cell の仕様 (DMA、データのアライメント、etc..)
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
44
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
45 + :maroon:`問題2` : :underline:`ゲーム開発用の Framework が無い`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
46
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
47 実験期間の大半を Cell の勉強に費やさねばならず、
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
48 開発されるゲームのレベルが例年一定以上にならない
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
49
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
50 研究目的
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
51 ============
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
52
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
53 Many Core Architecture を用いた並列プログラムの開発をサポートするフレームワーク :maroon:`Fine Grain Task Manager` を提案する
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
54
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
55 - 動作環境
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
56
24
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
57 - Mac OS X、Linux、PS3(Cell)
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
58
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
59 - Fine Grain Task の単位
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
60
24
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
61 - サブルーチンまたは関数
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
62
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
63 - Task Manager を用いた開発行程
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
64
24
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
65 1. 逐次型プログラム (MacOSX、Linux)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
66 #. データやコードを分割したプログラム (MacOSX、Linux)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
67 #. 並列に動かすプログラム (Cell)
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
68
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
69 各段階で信頼性を確保しながら開発を進める
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
70
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
71
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
72 研究目的 (Con't)
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
73 ==================
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
74
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
75 **Cerium**
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
76 Task Manager を用いた、PS3ゲーム開発用フレームワーク
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
77
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
78 Cerium は 3 つの機能で構成されている
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
79
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
80 - 独自の :maroon:`Rendering Engine`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
81 - ゲームに登場するオブジェクトやルールなど、ゲームを構成する要素を
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
82 木構造として持つ :maroon:`Scene Graph`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
83 - Rendering Engine や Scene Graph の処理単位を Task とし、複数の Core へ
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
84 割り振りを行うカーネル :maroon:`TaskManager`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
85
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
86
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
87 Cell アーキテクチャの概要
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
88 ===========================
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
89
24
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
90 - :silver:`研究の背景と目的`
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
91 - :big:`Cell アーキテクチャの概要`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
92 - :silver:`Many Core プログラミングの特徴`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
93 - :silver:`Task Manager の実装`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
94 - :silver:`Task Manager を用いた並列プログラム`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
95 - :silver:`Cerium`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
96 - :silver:`Cerium を用いたゲーム`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
97 - :silver:`まとめと今後の課題`
20
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
98
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
99 Cell Broadband Engine
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
100 ========================
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
101
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
102 .. image:: images/cell_arch.jpg
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
103 :align: center
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
104 :width: 280px
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
105
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
106 - 1個の PPE と 8 個の SPE がリングバスで構成されている
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
107
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
108 - Linux 側から使える SPE は 6 個
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
109
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
110 - SPE は :maroon:`256KB` の Local Store (LS) を持つ
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
111 - SPE からメインメモリへは直接アクセスできない
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
112
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
113 - SPE が持つ MFC (Memory Flow Controller) へ
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
114 :maroon:`DMA 命令` を送ることで行う
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
115
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
116 Cell の基本機能
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
117 =======================
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
118
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
119 - :maroon:`DMA (Direct Memory Access)`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
120
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
121 メインメモリと LS 間でデータが転送される
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
122
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
123 DMA 転送を行うにはいくつか条件がある
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
124
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
125 - データサイズは 16 バイトの倍数
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
126 - 転送元と転送先のアドレスが 16 バイト境界に揃えられている
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
127
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
128 - :maroon:`Mailbox`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
129
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
130 SPE の MFC 内にある FIFO キュー
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
131
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
132 PPE と SPE 間で 32 ビットメッセージの交換に用いられる
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
133
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
134 キューは 3 種類
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
135
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
136 - SPU Inbound Mailbox : PPE |rightarrow| SPE
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
137 - SPU Outbound Mailbox : SPE |rightarrow| PPE
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
138 - SPU Outbound interrupt Mailbox : SPE |rightarrow| PPE (割り込み)
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
139
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
140 Many Core プログラミングの特徴
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
141 ================================
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
142
24
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
143 - :silver:`研究の背景と目的`
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
144 - :silver:`Cell アーキテクチャの概要`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
145 - :big:`Many Core プログラミングの特徴`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
146 - :silver:`Task Manager の実装`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
147 - :silver:`Task Manager を用いた並列プログラム`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
148 - :silver:`Cerium`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
149 - :silver:`Cerium を用いたゲーム`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
150 - :silver:`まとめと今後の課題`
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
151
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
152
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
153 定常的な並列度の必要性
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
154 ========================
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
155
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
156 **Amdahl 則**
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
157 元のプログラムの並列化率が低ければ、その性能を生かすことは出来ない
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
158
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
159 .. image:: images/amdahl.jpg
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
160 :align: center
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
161 :width: 360px
20
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
162
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
163 .. raw:: html
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
164
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
165 <div align="center" style="font-size: large;">
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
166 6 CPU を使っても、プログラムの並列化率が 8 割程度では<br/>
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
167 3倍程度の性能向上しか得られない
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
168 </div>
20
800cdbaa2f64 add presentation file
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
169
23
51c95851ae11 fix presentation
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 21
diff changeset
170 Amdahl 則より、恒常的に並列プログラムの並列度を維持する必要がある
24
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
171
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
172
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
173 プログラム及びデータの分割
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
174 ============================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
175
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
176 プログラム中の並列度は、以下の形で取り出すことが可能
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
177
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
178 .. raw:: html
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
179
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
180 <table>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
181 <tr>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
182 <td style="border: 1px solid black;">
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
183 <img src="images/manycore_data_split.jpg" width="350">
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
184 </td>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
185 <td style="border: 1px solid black;">
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
186 <img src="images/manycore_pipeline.jpg" width="350">
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
187 </td>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
188 </tr>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
189 <tr>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
190 <td align="center">データ並列</td>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
191 <td align="center">パイプライン処理</td>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
192 </tr>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
193 </table>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
194
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
195 上二つの処理を行うには、プログラムとデータの適切な分割が必要
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
196
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
197 - プログラムの分割
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
198
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
199 - for 文、木構造で処理する個々のステートメント
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
200
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
201 - データの分割
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
202
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
203 - 自明には行えない可能性がある
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
204 - 分割できるデータ構造の採用が必要となる
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
205
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
206 Many Core の同期とデバッグ
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
207 ============================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
208
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
209
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
210 **同期**
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
211 複数の CPU がデータの待ち合わせ、または、整合性を維持するために、他の CPU との待ち合わせを行うこと
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
212
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
213 - 各 CPU が待ち合わせを行うと、並列度が下がってしまうため、同期自体を減らす必要がある
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
214
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
215 .. raw:: html
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
216
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
217 <div align="center">
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
218 &darr;
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
219 </div>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
220
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
221 - 各 CPU が独立に (ロック無しで) データにアクセスできる様にデータを分割すれば良い
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
222
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
223 **デバッグ**
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
224
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
225 - 並列プログラムの実行は非決定的
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
226
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
227 - 非決定的 = 同じ状態で実行しても結果が異なる
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
228
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
229 - バグの状態を再現することが難しい
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
230
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
231 - 個々の CPU 上のデータを調べる必要がある
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
232
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
233
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
234 並列プログラムの開発行程
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
235 ==========================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
236
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
237 並列プログラミングでは、以下の段階において、それぞれ実装とテストを行う。
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
238
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
239 1. C によるシーケンシャルな実装
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
240 2. 並列実行を考慮したデータ構造を持つ実装
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
241 3. コードを分割し、シーケンシャルに実行する実装
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
242 4. 分割したコードを並列実行する実装
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
243
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
244
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
245 比較 - Gallium
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
246 ===========================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
247
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
248 .. _Gallium: http://www.tungstengraphics.com/wiki/index.php/Gallium3D
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
249 .. _OSMesa: http://www.mesa3d.org/
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
250
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
251 Gallium_
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
252 オープンソースの 3D グラフィックドライバ
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
253
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
254 フレームバッファエンジン用のレンダリングエンジンである OSMesa_ の
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
255 Cell ドライバとして用いられている
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
256
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
257 - Triangle (Polygon) を SPE に送り、その中から得られた Span に
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
258 テクスチャを貼ってレンダリングする
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
259 - SPE は6 個使用
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
260 - SIMD 演算を積極的に使用している。
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
261
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
262 先行研究では Rendering Engine に OSMesa を使用していたため、
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
263 Cerium Rendering Engine のレンダリング手法は OSMesa を参考にしている
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
264
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
265
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
266 比較 - Gallium (Con't)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
267 ====================================================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
268
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
269 - 先行研究 (神里)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
270
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
271 - 現在 PS3Linux からは :maroon:`GPU にアクセスできない`
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
272 - :maroon:`フレームバッファは使用できる` ため、OSMesa を使用
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
273 - OSMesa の機能の一部を SPE に乗せ、高速化に成功
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
274 - ソースコードの複雑化を招いた
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
275
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
276 - OSMesa の元々の実装の影響 (巨大なマクロ、構造体)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
277
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
278 - 以降のメンテナンスや機能の追加、改良が困難と判断
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
279 - 独自に Rendering Engine を持つことに
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
280
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
281 - Gallium
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
282
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
283 - OSMesa の Cell Driver
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
284 - OpenGL + Gallium でのゲーム開発は可能
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
285 - PS3 上のゲーム開発において、レンダリングのみを SPE に実装するのでは足りない
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
286
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
287 - ゲームに登場するオブジェクトの計算 (衝突判定等)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
288 - Amdahl 則の問題
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
289
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
290 - レンダリングだけでなく、ゲームオブジェクトも SPE で処理できるように
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
291 しなければならない
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
292
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
293 - Cerium
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
294
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
295 - SceneGraph、レンダリングを SPE 上で処理する
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
296
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
297 比較 - Gallium (Con't)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
298 ==========================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
299
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
300 - 実行速度比較
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
301
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
302 - 出力解像度は 1920x1080
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
303 - 地球のテクスチャを貼った球体のオブジェクトを表示
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
304
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
305 .. image:: images/com_gallium.jpg
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
306 :align: center
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
307 :width: 350px
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
308
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
309 ===================== ===============
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
310 Gallium (SPE 6 個) 5.4 FPS
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
311 --------------------- ---------------
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
312 Cerium (SPE 1 個) 2.5 FPS
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
313 --------------------- ---------------
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
314 Cerium (SPE 6 個) :maroon:`9.5 FPS`
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
315 ===================== ===============
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
316
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
317
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
318 比較 - OpenGL
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
319 ==========================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
320
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
321 .. _OpenGL: http://www.opengl.org/
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
322
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
323 OpenGL_
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
324 オープンソースの3Dグラフィックスプログラムインターフェース
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
325
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
326 - ポリゴンの描画
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
327
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
328 .. raw:: html
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
329
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
330 <div align="center" style="color: maroon; font-size: large;">
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
331 // 線分3つ指定し、三角形を生成<br/>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
332 glVertex3d(x1, y1, z1);<br/>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
333 glVertex3d(x2, y2, z2);<br/>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
334 glVertex3d(x3, y3, z3);<br/>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
335 </div>
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
336
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
337 - OpenGL での親子関係の表現
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
338
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
339 glPushMatrix();
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
340 //現在処理してるオブジェクトの変換行列をスタックに登録
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
341
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
342 makePolygon();
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
343 //このオブジェクトは今まで Push された変換行列の影響を受ける
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
344
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
345 glPopMatrix();
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
346 //スタックから変換行列を取り出す
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
347
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
348
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
349 比較 - OpenGL (Con't)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
350 ==========================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
351
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
352 レンダリングは Cerium Rendering Engine を用いて、
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
353 ゲームオブジェクトの操作は OpenGL を用いることでゲーム開発は可能
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
354
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
355 - OpenGL が持つレンダリングドライバは使用せずに、オブジェクトの操作結果をポリゴンとして出力するためには、各オブジェクトの変換行列が必要
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
356
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
357 - 各オブジェクトのパラメータは変換行列が掛けられる前の状態を保持
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
358
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
359 - 変換行列は OpenGL が内部にもつ Matrix Stack に格納されている
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
360
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
361 - Matrix Stack から、 :maroon:`各オブジェクトに対応する変換行列` を取り出す必要がある
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
362
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
363 最初から自身の変換行列を持っている SceneGraph というデータ構造を用いれば、
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
364 SPE 上でオブジェクトの操作から変換行列による更新まで一括して行える
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
365
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
366
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
367
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
368 比較 - OpenCL
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
369 =====================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
370
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
371 **OpenCL**
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
372 マルチコアCPUやGPU、その他のプロセッサによる、ヘテロジニアスコンピューティングのフレームワーク
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
373
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
374 .. image:: images/cp_opencl_plat.jpg
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
375 :align: center
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
376 :width: 300px
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
377
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
378 - Host から PE へ実行コマンドが送られる
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
379 - Host や OpenCL Device はコマンドの管理を行う kernel を持つ
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
380 - OpenCL Device 毎に独立したメモリ領域を持つ
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
381 - データ並列、タスク並列をサポート
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
382
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
383 比較 - OpenCL (Con't)
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
384 ======================
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
385
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
386 **OpenCL**
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
387
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
388 - あらゆる Many Core Architecture に対応できるような汎用的な実装
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
389 - 開発環境にあわせた記述が必要
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
390
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
391 **Task Manager**
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
392
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
393 - Cell アーキテクチャに重きを置いた記述
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
394 - DMA によるメモリアクセスなど、決まった記述で開発できる
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
395 - 大幅なコードの変更無く Mac OS X や Linux など複数の環境で動作させることが可能
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
396
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
397 Task Manager は :maroon:`OpenCL による実装の一つ` と言える
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
398
de8ba175cc9b add 比較
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 23
diff changeset
399 - 学生による Cell プログラミングフレームワークとしては Task Manager が扱いやすい