Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
90
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
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.2k
SwiftUIで本格音ゲー実装してみた
hypebeans
0
380
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
7.3k
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.8k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
180
AWS CDKの推しポイントN選
akihisaikeda
1
240
Integrating WordPress and Symfony
alexandresalome
0
150
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
490
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
FluorTracer / RayTracingCamp11
kugimasa
0
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
110
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
RailsConf 2023
tenderlove
30
1.3k
The Language of Interfaces
destraynor
162
25k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
The Cult of Friendly URLs
andyhume
79
6.7k
Visualization
eitanlees
150
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Code Reviewing Like a Champion
maltzj
527
40k
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