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
120
Metal Demo
alienxp03
September 14, 2015
Tweet
Share
More Decks by alienxp03
See All by alienxp03
Rails, Capistrano & AWS
alienxp03
0
89
iOS Tools
alienxp03
1
190
RxSwift+MVVM
alienxp03
1
500
From a student to a developer
alienxp03
1
110
Other Decks in Programming
See All in Programming
Workers を定期実行する方法は一つじゃない
rokuosan
0
140
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
2
1.8k
新世界の理解
koriym
0
130
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
1.8k
Understanding Kotlin Multiplatform
l2hyunwoo
0
250
書き捨てではなく継続開発可能なコードをAIコーディングエージェントで書くために意識していること
shuyakinjo
1
250
なぜあなたのオブザーバビリティ導入は頓挫するのか
ryota_hnk
5
580
あのころの iPod を どうにか再生させたい
orumin
2
2.3k
Go製CLIツールをnpmで配布するには
syumai
2
1.1k
Amazon Q CLI開発で学んだAIコーディングツールの使い方
licux
3
180
ZeroETLで始めるDynamoDBとS3の連携
afooooil
0
150
대규모 트래픽을 처리하는 프론트 개발자의 전략
maryang
0
120
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
Automating Front-end Workflow
addyosmani
1370
200k
Code Review Best Practice
trishagee
69
19k
Bash Introduction
62gerente
614
210k
BBQ
matthewcrist
89
9.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Site-Speed That Sticks
csswizardry
10
760
How STYLIGHT went responsive
nonsquared
100
5.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
8
550
Designing for Performance
lara
610
69k
Docker and Python
trallard
45
3.5k
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