Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Metal Demo
Search
alienxp03
September 14, 2015
Programming
0
130
Metal Demo
alienxp03
September 14, 2015
Tweet
Share
More Decks by alienxp03
See All by alienxp03
Rails, Capistrano & AWS
alienxp03
0
92
iOS Tools
alienxp03
1
200
RxSwift+MVVM
alienxp03
1
510
From a student to a developer
alienxp03
1
110
Other Decks in Programming
See All in Programming
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
320
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
710
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
210
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
150
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.7k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.3k
Codex の「自走力」を高める
yorifuji
0
1.2k
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
210
モダンOBSプラグイン開発
umireon
0
110
OTP を自動で入力する裏技
megabitsenmzq
0
100
Docコメントで始める簡単ガードレール
keisukeikeda
1
110
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
How to train your dragon (web standard)
notwaldorf
97
6.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
180
Bash Introduction
62gerente
615
210k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Statistics for Hackers
jakevdp
799
230k
Done Done
chrislema
186
16k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Un-Boring Meetings
codingconduct
0
220
Transcript
GPU Programming in Metal • Twitter: @alienxp03 • Not a
GPU programmer
Metal • Introduced in iOS 8 • Only for iOS
devices • Usage - Graphic rendering - Parallel data computation
Basic guide • Initialise Metal
Basic guide • Call the compiled shader function
Basic guide • Set parameters
Basic guide • Threadgroups
Basic guide • Run the computation • Get the result
Shader language • Using C++11 with some extension and limitation
pow(x, y) • 12,228 integers - CPU : 0.028833416668931 secs
- GPU : 0.0302730000112206 secs
pow(x, y) • 33,554,432 integers (2 ^ 25 ) -
CPU : 73.7681545416708 secs - GPU : 38.1098593333445 secs
Implementation • Didn’t compare precise::pow vs fast::pow • Initialise the
array on CPU, then pass it to GPU for computation • Using CPU cache memory
None
iOS 9 • Metal is now available on OS X
too • MTLResourceOptions
iOS 9 • Instrument, Metal System Trace
None
Lesson learned • We have GPU too, and it’s pretty
powerful • And it’s idle almost the whole time
Real world application • For data simulation or visualisation •
Though the truth is, I have no idea • Just did it for fun
GPU Programming in Metal • Twitter: @alienxp03 • Not a
GPU programmer