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
旅行プランAIエージェント開発の裏側
ippo012
1
580
オープンセミナー2025@広島LT技術ブログを続けるには
satoshi256kbyte
0
150
tool ディレクティブを導入してみた感想
sgash708
1
160
Portapad紹介プレゼンテーション
gotoumakakeru
1
130
Protocol Buffersの型を超えて拡張性を得る / Beyond Protocol Buffers Types Achieving Extensibility
linyows
0
100
SOCI Index Manifest v2が出たので調べてみた / Introduction to SOCI Index Manifest v2
tkikuc
1
120
Jakarta EE Core Profile and Helidon - Speed, Simplicity, and AI Integration
ivargrimstad
0
280
パスタの技術
yusukebe
1
550
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
120
AHC051解法紹介
eijirou
0
640
More Approvers for Greater OSS and Japan Community
tkikuc
1
100
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
130
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
51k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
Visualization
eitanlees
147
16k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Docker and Python
trallard
45
3.5k
Building an army of robots
kneath
306
46k
How to train your dragon (web standard)
notwaldorf
96
6.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Done Done
chrislema
185
16k
Facilitating Awesome Meetings
lara
55
6.5k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
KATA
mclloyd
32
14k
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