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
86
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
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
170
技術同人誌をMCP Serverにしてみた
74th
1
640
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
2.1k
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
5.5k
Rails Frontend Evolution: It Was a Setup All Along
skryukov
0
140
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
190
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
5
7.2k
Porting a visionOS App to Android XR
akkeylab
0
460
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
700
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
320
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
150
ふつうの技術スタックでアート作品を作ってみる
akira888
1
820
Featured
See All Featured
Docker and Python
trallard
44
3.5k
A better future with KSS
kneath
238
17k
The Language of Interfaces
destraynor
158
25k
GraphQLとの向き合い方2022年版
quramy
49
14k
Documentation Writing (for coders)
carmenintech
72
4.9k
Music & Morning Musume
bryan
46
6.6k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
Typedesign – Prime Four
hannesfritz
42
2.7k
Adopting Sorbet at Scale
ufuk
77
9.5k
The Invisible Side of Design
smashingmag
301
51k
The World Runs on Bad Software
bkeepers
PRO
69
11k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
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