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
71
iOS Tools
alienxp03
1
180
RxSwift+MVVM
alienxp03
1
490
From a student to a developer
alienxp03
1
99
Other Decks in Programming
See All in Programming
How to Break into Reading Open Source
kaspth
2
220
AndroidアプリのUIバリエーションをあの手この手で確認する / Check UI variations of Android apps by various means
tkmnzm
1
190
GoのIteratorに詳しくなってしまう
inatonix
1
200
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
510
全部見せます! クラシルリワードのSwiftTesting移行プロジェクト
uetyo
0
210
Pythonで改めて考える「クラス(class)」の使いどころ
os1ma
3
830
マルチモジュールにおけるテスト最適化
fxwx23
0
210
Architecture Decision Record (ADR)
nearme_tech
PRO
1
690
Patched fetch did not work
quramy
4
400
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
230
The Shape of a Service Object
inem
0
520
LangChainでWebサイトの内容取得やGitHubソースコード取得
shukob
0
160
Featured
See All Featured
Web Components: a chance to create the future
zenorocha
309
42k
What's in a price? How to price your products and services
michaelherold
242
11k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Six Lessons from altMBA
skipperchong
26
3.4k
Building Your Own Lightsaber
phodgson
101
6k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Intergalactic Javascript Robots from Outer Space
tanoku
268
26k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
1
55
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
43
2k
Building Applications with DynamoDB
mza
90
6k
Statistics for Hackers
jakevdp
794
220k
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