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 for data-parallel computations
Search
kotetu (kotetuco)
September 02, 2018
Programming
1
1.3k
Metal for data-parallel computations
グラフィックス以外の分野でのMetalの可能性
iOSDC 2018 LT 発表資料
kotetu (kotetuco)
September 02, 2018
Tweet
Share
More Decks by kotetu (kotetuco)
See All by kotetu (kotetuco)
認証体験向上のために passkeys (パスキー) に対応する 〜 メリット・対応方法について / iosdcjapan-2023-passkeys
kotetuco
3
1.5k
着信時氏名表示させたいエンジニア vs 簡単には着信時氏名表示できない電話番号 (iOS13対応版) / iosdcjapan-2020-lt-calldirectory
kotetuco
2
1.1k
UIImage and CIImage for Image Processing
kotetuco
9
6.3k
Preparing for Swift 5 Ownership
kotetuco
0
4.8k
プログラミング言語RustとOS開発/rust-os-develop-introduction
kotetuco
0
1.6k
Sansan iOSアプリと R&Dとの共同研究について/sansan-ios-and-reearch
kotetuco
0
550
OS Developer として Rustを使ってみる/using-rust-for-os-developer
kotetuco
0
580
Other Decks in Programming
See All in Programming
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
200
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
受け取る人から提供する人になるということ
little_rubyist
0
230
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
GitHub's CSS Performance
jonrohan
1030
460k
Adopting Sorbet at Scale
ufuk
73
9.1k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
How STYLIGHT went responsive
nonsquared
95
5.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Facilitating Awesome Meetings
lara
50
6.1k
Become a Pro
speakerdeck
PRO
25
5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Transcript
άϥϑΟοΫεҎ֎ͷ ͰͷMetalͷՄೳੑ iOSDC 2018 (2018/9/2) @kotetu
Kuriyama Toru (܀ࢁప) iOS / Android developer ɹɹɹɹɹɹɹɹat Sansan app
(iOS/Android) Twitter: @kotetuɹɹɹɹɹɹ Github, Qiita: @kotetuco
Metal • GPUΛ͏ͨΊͷFramework • ओʹ3DάϥϑΟοΫεͰ༻ • άϥϑΟοΫεͰ͔͑͠ͳ ͍Θ͚Ͱͳ͍ 3 /
14
Metalͷ༻్ “Render advanced 3D graphics and perform data-parallel computations using
the GPU.” ʮGPUΛͬͨߴͳ3DϨϯμϦϯάͱฒྻॲཧʯ https://developer.apple.com/documentation/metal 4 / 14
Metalͷ༻్ “Render advanced 3D graphics and perform data-parallel computations using
the GPU.” ʮGPUΛͬͨߴͳ3DϨϯμϦϯάͱฒྻॲཧʯ https://developer.apple.com/documentation/metal 4 / 14 3DάϥϑΟοΫεҎ֎ͷ༻్ఆ
GPUͷಛੑ • 1ίΞ͋ͨΓͷੑೳCPUͷํ͕ߴ͍͕ίΞ CPUΑΓଟ͍ • ʮCPUεϙʔπΧʔɺGPUόεʯ • ฒྻॲཧʹ͍ͨΞʔΩςΫνϟ Ҿ༻ɿiOSDC 2017ʮඈͼಓ۩Ͱͳ͍Metalʯ(@shu223͞Μ)
ൃදࢿྉ 5 / 14
ฒྻॲཧͷԸܙΛड͚ͦ͏ͳɹ • ը૾ॲཧ • ػցֶश(ਪ) • ཧγϛϡϨʔγϣϯ 6 /
14
ฒྻॲཧͷԸܙΛड͚ͦ͏ͳɹ • ը૾ॲཧ • ػցֶश(ਪ) • ཧγϛϡϨʔγϣϯ 6 /
14
ը૾ॲཧ • Core Image (Core Imageͷը૾ॲཧͷҰ෦ ෦ͰMetalΛ༻͍ͯ͠Δ) • Core Image͕αϙʔτ͍ͯ͠ͳ͍ը૾ॲཧ
OpenCVͳͲͷը૾ॲཧϥΠϒϥϦΛ͏ 7 / 14
OpenCV • ը૾ॲཧɾίϯϐϡʔλϏδϣϯϥΠϒϥϦ • PCͷGPUʹରԠ͍ͯ͠Δ͕MetalʹରԠ ͍ͯ͠ͳ͍ • iOS্ͰGPUͷԸܙΛड͚ΒΕͳ͍ 8 /
14
࣮ݧɿը૾ॲཧͷॲཧ࣌ؒɹɹ Λൺֱɹɹ • OpenCV (CPU) • Metal (GPU) • Metal
Performance Shader ɹɹɹɹɹ (MetalΛͬͨը૾ɾฒྻॲཧϥΠϒϥϦ) 9 / 14
༻ͨ͠ը૾ https://pixabay.com/photo-3599450/ ը૾αΠζɿ5984 × 3989 ϑΝΠϧαΠζɿ6.9MB (JPEG) 10 / 14
ൺֱʹ༻͍ͨը૾ॲཧ 11 / 14 1. ೋԽ (നࠇը૾ม) 2. ը૾ͷॖখ 3.
ॖখ + ΅͔͠
ݕূ༻ΞϓϦ • githubʹ͋Γ·͢(Լهࢀর) • Xcode 10 (beta 6) • iOS11+
(࣮ػ͕ඞཁ) • OpenCV 3.4.2 12 / 14 https://github.com/kotetuco/ComparisonOfMetalAndOpenCV
ݕূ݁Ռ 13 / 14 ※ ୯ҐϛϦඵɺ༻ iPhone 8 Plusɹ(iOS11.3.1)
ݕূ݁Ռ 13 / 14 ※ ୯ҐϛϦඵɺ༻ iPhone 8 Plusɹ(iOS11.3.1) Metal͕
͍
·ͱΊ • MetalΛ͑ඞͣ͘ͳΔΘ͚Ͱͳ͍ • ୯७ͳฒྻॲཧͰGPU༻ϝϞϦͷίϐʔ CPU-GPUؒ௨৴ͷ࣌ؒΛແࢹͰ͖ͳ͍ • ෳͷॲཧΛ·ͱΊͯߦ͍͍ͨ߹ʹMetal͕༗ར • Metal(GPU)ʹ͍͍ͯΔ͔Ͳ͏͔ͷݟۃΊ͕େࣄ
14 / 14