SlideShare a Scribd company logo
ARM Compute Libraray
https://developer.arm.com/technologies/compute-library
ARMが公開した画像処理およびCNNライブラリ
Linux / Android / Bare Metalで利用可能 
2017.04.01(土)
@Vengineer
クロスコンパイラの用意
AArch64 : arm64-v8a
gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu
ARM : armv7a
aro/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf
ビルド
% scons debug=1 neon=1 opencl=0 arch=arm64-v8a
Werror : Enable/disable the -Werror compilation flag (Default=1) (0|1)
debug : Debug (default=0) (0|1)
arch : Target Architecture
(default=armv7a) (armv7a|arm64-v8a|arm64-v8.2-a|x86)
os : Target OS (default=linux) (linux|android|bare_metal)
build : Build type: (default=cross_compile) (native|cross_compile)
opencl : Enable OpenCL support(Default=1) (0|1)
neon : Enable Neon support(Default=0) (0|1)
OpenCL対応
libOpenCL.so がGPU(ARM Mali)をサポートしているときのみ利用可能
この資料では、NEONのみについて説明します
画像処理関連
 ・Basic arithmetic, mathematical and binary operator functions
 ・Colour manipulation (conversion, channel extraction, and more)
 ・Convolution filters (Sobel, Gaussian, and more)
 ・Canny Edge, Harris corners, optical flow and more
 ・Pyramids (such as Laplacians)
 ・HOG (Histogram of Oriented Gradients)
 ・SVM (Support Vector Machines)
 ・H/SGEMM (Half and Single precision General Matrix Multiply)
Convolutional Neural Networks関連
 ・Activation
 ・Convolution
 ・Fully connected
 ・Locally connected
 ・Normalization
 ・Pooling
 ・Soft-max
サンプルコード:scale (NEON)
PPMLoader ppm; ppmファイル
Image src, dst; イメージバッファ
ppm.open(argv[1]); ファイルオープン
ppm.init_image(src, Format::U8); イメージ読み込み
constexpr int scale_factor = 2;
TensorInfo dst_tensor_info( 入力テンソル情報
src.info()->dimension(0) / scale_factor,
src.info()->dimension(1) / scale_factor,
Format::U8);
サンプルコード:scale (NEON)
dst.allocator()->init(dst_tensor_info); 初期化
NEScale scale; スケール
scale.configure(&src, &dst, コンフィギュレーション
InterpolationPolicy::NEAREST_NEIGHBOR,
BorderMode::UNDEFINED);
src.allocator()->allocate(); メモリ割当て
dst.allocator()->allocate(); メモリ割当て
scale.run(); 実行
サンプルコード:convolution (NEON)
PPMLoader ppm; ppmファイル
Image src, tmp, dst; イメージバッファ
ppm.open(argv[1]); ファイルオープン
ppm.init_image(src, Format::U8); イメージ読み込み
tmp.allocator()->init(*src.info()); 初期化
dst.allocator()->init(*src.info()); 初期化
NEConvolution3x3 conv3x3; 3x3 Convolution
NEConvolution5x5 conv5x5; 5x5 Convolution
サンプルコード:convolution (NEON)
conv3x3.configure(&src, &tmp, コンフィギュレーション
gaussian3x3, 0, BorderMode::UNDEFINED);
conv5x5.configure(&tmp, &dst, コンフィギュレーション
gaussian5x5, 0, BorderMode::UNDEFINED);
src.allocator()->allocate(); メモリ割当て
tmp.allocator()->allocate(); メモリ割当て
dst.allocator()->allocate(); メモリ割当て
conv3x3.run(); 実行
conv5x5.run(); 実行
スケジューラ
arm_compute/runtime/NEON/CPPScheduler.h
arm_compute/runtime/NEON/NEScheduler.h
namespace arm_compute
{
using NEScheduler = CPPScheduler;
}
NEScheduler は、CPPScheduler と同じ
multithread(スレッド無し)
void CPPScheduler::multithread(ICPPKernel *kernel, const size_t split_dimension)
{
const Window &max_window = kernel->window();
const int num_iterations = max_window.num_iterations(split_dimension);
int num_threads = std::min(num_iterations, _num_threads);
if(!kernel->is_parallelisable() || 1 == num_threads)
{
kernel->run(max_window);
}
}
multithread (スレッド有り)
for(int t = 0; t < num_threads; ++t)
{
Window win = max_window.split_window(split_dimension, t, num_threads);
win.set_thread_id(t);
win.set_num_threads(num_threads);
if(t != num_threads - 1)
{
_threads[t].start(kernel, win);
}
else
{
kernel->run(win);
}
}
サンプルカーネル:NEScaleKernel
void NEScaleKernel::run(const Window &window)
{
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INEKernel::window(), window);
ARM_COMPUTE_ERROR_ON(_func == nullptr);
(this->*_func)(window);
}
_func = &NEScaleKernel::scale_nearest;
_func = &NEScaleKernel::scale_bilinear;
_func = &NEScaleKernel::scale_area;
おしまい

More Related Content

PDF
ARM CPUにおけるSIMDを用いた高速計算入門
PDF
いまさら聞けないarmを使ったNEONの基礎と活用事例
PPTX
研究者のための Python による FPGA 入門
PDF
PFNのML/DL基盤を支えるKubernetesにおける自動化 / DevOpsDays Tokyo 2021
PDF
レシピの作り方入門
PPTX
CPU / GPU高速化セミナー!性能モデルの理論と実践:理論編
PDF
組み込み関数(intrinsic)によるSIMD入門
PDF
CUDAプログラミング入門
ARM CPUにおけるSIMDを用いた高速計算入門
いまさら聞けないarmを使ったNEONの基礎と活用事例
研究者のための Python による FPGA 入門
PFNのML/DL基盤を支えるKubernetesにおける自動化 / DevOpsDays Tokyo 2021
レシピの作り方入門
CPU / GPU高速化セミナー!性能モデルの理論と実践:理論編
組み込み関数(intrinsic)によるSIMD入門
CUDAプログラミング入門

What's hot (20)

PDF
KVM環境におけるネットワーク速度ベンチマーク
PDF
第9回ACRiウェビナー_セック/岩渕様ご講演資料
PDF
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
PDF
Ultra96ボードでYOLOを高速化
PDF
リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門
PDF
ARM Trusted FirmwareのBL31を単体で使う!
PDF
プログラムを高速化する話Ⅱ 〜GPGPU編〜
KEY
PyOpenCLによるGPGPU入門
PPTX
Fugaku, the Successes and the Lessons Learned
PPTX
OSを手作りするという趣味と仕事
PDF
ACRiウェビナー:小野様ご講演資料
PDF
マルチコアを用いた画像処理
PDF
Intro to SVE 富岳のA64FXを触ってみた
PDF
プログラムを高速化する話
PDF
Zynq mp勉強会資料
PDF
TripleOの光と闇
PDF
30分で分かる!OSの作り方 ver.2
PDF
データ爆発時代のネットワークインフラ
PDF
CPU / GPU高速化セミナー!性能モデルの理論と実践:実践編
PPTX
CEDEC2017 VR180 3D live streaming camera at "SHOWROOM" case
KVM環境におけるネットワーク速度ベンチマーク
第9回ACRiウェビナー_セック/岩渕様ご講演資料
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
Ultra96ボードでYOLOを高速化
リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門
ARM Trusted FirmwareのBL31を単体で使う!
プログラムを高速化する話Ⅱ 〜GPGPU編〜
PyOpenCLによるGPGPU入門
Fugaku, the Successes and the Lessons Learned
OSを手作りするという趣味と仕事
ACRiウェビナー:小野様ご講演資料
マルチコアを用いた画像処理
Intro to SVE 富岳のA64FXを触ってみた
プログラムを高速化する話
Zynq mp勉強会資料
TripleOの光と闇
30分で分かる!OSの作り方 ver.2
データ爆発時代のネットワークインフラ
CPU / GPU高速化セミナー!性能モデルの理論と実践:実践編
CEDEC2017 VR180 3D live streaming camera at "SHOWROOM" case
Ad

Viewers also liked (20)

DOCX
Biases in military history
PDF
In the DOM, no one will hear you scream
PDF
グローバル理工人材のための今日から使える検索テクニック ―もう日本語でググるのはやめよう
PDF
GroovyFX - Groove JavaFX
PPTX
Alejandro Fernandez vs Luis Miguel
PDF
マイクロソフトが創る未来 医療編 20170401
PDF
Green Behavior
PPTX
Elixir-Conf-Japan-2017-session-ohr486
PPTX
Tercera Trobada #Xatac5a Tarragona
PDF
A deep dive into Drupal 8 routing
PDF
フェーズI/IIに置けるベイジアン・アダプティブ・メソッド
PDF
Marketing's important. But marketers often aren't.
PPTX
Immunisation against bacteria
PPTX
Mr. Nitin bassi IEWP @ 2nd India-EU Water Forum @ World Sustainable Developme...
PPTX
A Building Framework for the All Renewable Energy Future
PPTX
Wasabi waiter game - Gamification in recruitment - Manu Melwin Joy
PDF
Frank Michael encore un peu plus riche
PDF
Experience WOW. A new benchmark in MDP / EDP
PPT
Critiques of Community Forestry
PDF
Groeispurt voor bvba kunstenaar Koen Vanmechelen
Biases in military history
In the DOM, no one will hear you scream
グローバル理工人材のための今日から使える検索テクニック ―もう日本語でググるのはやめよう
GroovyFX - Groove JavaFX
Alejandro Fernandez vs Luis Miguel
マイクロソフトが創る未来 医療編 20170401
Green Behavior
Elixir-Conf-Japan-2017-session-ohr486
Tercera Trobada #Xatac5a Tarragona
A deep dive into Drupal 8 routing
フェーズI/IIに置けるベイジアン・アダプティブ・メソッド
Marketing's important. But marketers often aren't.
Immunisation against bacteria
Mr. Nitin bassi IEWP @ 2nd India-EU Water Forum @ World Sustainable Developme...
A Building Framework for the All Renewable Energy Future
Wasabi waiter game - Gamification in recruitment - Manu Melwin Joy
Frank Michael encore un peu plus riche
Experience WOW. A new benchmark in MDP / EDP
Critiques of Community Forestry
Groeispurt voor bvba kunstenaar Koen Vanmechelen
Ad

Similar to ARM Compute Library (20)

PPTX
CMake multiplatform build-tool
KEY
GTC2011 Japan
PDF
1072: アプリケーション開発を加速するCUDAライブラリ
PDF
RTミドルウェアによるロボットプログラミング技術 2.プログラミングの基礎
DOC
GPGPUによるパーソナルスーパーコンピュータの可能性
PDF
OpenCVをAndroidで動かしてみた
PDF
181106 02
PPTX
C++ AMPを使ってみよう
PDF
組み込みxAI
PDF
DartVM on Android
PDF
200625material naruse
PDF
GPU と PYTHON と、それから最近の NVIDIA
PPTX
2012 1203-researchers-cafe
PDF
【A-1】AIを支えるGPUコンピューティングの今
PDF
NetBSDのクロスビルドのしくみとインストール済みLive Imageの作成
PDF
GPU-FPGA 協調計算を記述するためのプログラミング環境に関する研究(HPC169 No.10)
PPTX
大人の分散レンダリング
PDF
20170823【GWゼミ #2】AWS Lambda上でOpenCVを使った画像処理
PDF
JTF2020 クロスコンパイルだけが能ではない組み込みLinuxシステムのCI/CDインフラ構築
PDF
研究を加速するChainerファミリー
CMake multiplatform build-tool
GTC2011 Japan
1072: アプリケーション開発を加速するCUDAライブラリ
RTミドルウェアによるロボットプログラミング技術 2.プログラミングの基礎
GPGPUによるパーソナルスーパーコンピュータの可能性
OpenCVをAndroidで動かしてみた
181106 02
C++ AMPを使ってみよう
組み込みxAI
DartVM on Android
200625material naruse
GPU と PYTHON と、それから最近の NVIDIA
2012 1203-researchers-cafe
【A-1】AIを支えるGPUコンピューティングの今
NetBSDのクロスビルドのしくみとインストール済みLive Imageの作成
GPU-FPGA 協調計算を記述するためのプログラミング環境に関する研究(HPC169 No.10)
大人の分散レンダリング
20170823【GWゼミ #2】AWS Lambda上でOpenCVを使った画像処理
JTF2020 クロスコンパイルだけが能ではない組み込みLinuxシステムのCI/CDインフラ構築
研究を加速するChainerファミリー

More from Mr. Vengineer (20)

PDF
XilinxのxsimでSoftware Driven Verification.pdf
PDF
VerilatorとSystemCでSoftware Driven Verification
PDF
VerilatorとSystemC
PDF
TVM VTA (TSIM)
PDF
Cloud TPU Driver API ソースコード解析
PDF
Cloud Deep Learning Chips Training & Inference
PDF
TensorFlow Lite Delegateとは?
PDF
Pixel Visual Core device driver source code analysis
PDF
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2 「エッジAIモダン計測制御の世界」オ...
PDF
TensorFlow XLA 「XLAとは、から、最近の利用事例について」
PDF
Facebook Glow Compiler のソースコードをグダグダ語る会
PDF
Ultra96(UltraZed)実践勉強会
PDF
Bridge TensorFlow to run on Intel nGraph backends (v0.4)
PDF
Bridge TensorFlow to run on Intel nGraph backends (v0.5)
PDF
TensorFlow XLA RPC
PDF
TensorFlow local Python XLA client
PDF
Tiramisu をちょっと、味見してみました。
PDF
LeFlowを調べてみました
PDF
Tensorflow dynamically loadable XLA plugin ソースコード解析
PDF
Tiramisu概要
XilinxのxsimでSoftware Driven Verification.pdf
VerilatorとSystemCでSoftware Driven Verification
VerilatorとSystemC
TVM VTA (TSIM)
Cloud TPU Driver API ソースコード解析
Cloud Deep Learning Chips Training & Inference
TensorFlow Lite Delegateとは?
Pixel Visual Core device driver source code analysis
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2 「エッジAIモダン計測制御の世界」オ...
TensorFlow XLA 「XLAとは、から、最近の利用事例について」
Facebook Glow Compiler のソースコードをグダグダ語る会
Ultra96(UltraZed)実践勉強会
Bridge TensorFlow to run on Intel nGraph backends (v0.4)
Bridge TensorFlow to run on Intel nGraph backends (v0.5)
TensorFlow XLA RPC
TensorFlow local Python XLA client
Tiramisu をちょっと、味見してみました。
LeFlowを調べてみました
Tensorflow dynamically loadable XLA plugin ソースコード解析
Tiramisu概要

ARM Compute Library