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
74
iOS Tools
alienxp03
1
180
RxSwift+MVVM
alienxp03
1
500
From a student to a developer
alienxp03
1
100
Other Decks in Programming
See All in Programming
情報漏洩させないための設計
kubotak
4
730
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
370
nekko cloudにおけるProxmox VE利用事例
irumaru
3
450
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
340
return文におけるstd::moveについて
onihusube
1
1.2k
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
130
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
110
Beyond ORM
77web
8
1.2k
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
920
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
1
390
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Music & Morning Musume
bryan
46
6.2k
Speed Design
sergeychernyshev
25
670
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
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