SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Optimizing NDK projects
for multiple CPU architectures


       Alexander Weggerle
       Technical Consultant Engineer
       Intel Software and Services Group
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Introduction

• Performance critical apps are popular
 • Games
 • Real time multimedia
 • Augmented reality

• Users are sensitive
 • Don’t accept lags
 • Fluid animations
 • Minimal load time

                  Optimization is important


                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Compatibility

             “I want my app to run on all architectures”




• You already done for Java & HTML

• NDK based apps usually just needs a recompilation
          APP_ABI := all

                                                            Application.mk




                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Target compiler options

• NDK-build system Android.mk file evaluated for
  each architecture

• Variable TARGET_ARCH_ABI describes actual
  architecture

  TARGET_ARCH_ABI                                ifeq ($(TARGET_ARCH_ABI),x86)
                                                 LOCAL_CFLAGS     := -mtune=atom -mssse3
  x86                                            endif

  armeabi                                        ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
                                                 LOCAL_CFLAGS     := -march=armv7-a
  armeabi-v7a                                    Endif
  mips                                                                                  Android.mk




                       Copyright© 2012, Intel Corporation. All rights reserved.
                 *Other brands and names are the property of their respective owners.
Recommended Compiler options (x86)

• -mtune=atom
 • Out of Order scheduling

• -march=atom
 • movbe instruction
 • Code is only guaranteed to run on Atom.
   – Might not run on emulator or other CPUs

• -ansi-alias / -restrict / -no-prec-div




                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Multiple Code Paths

• Different reasons for multiple code paths
 • Optimizing for multiple architectures
 • Single Instruction Multiple Data (SIMD)
 • Assembly kernels
 • Memory alignment
 • Instruction set support




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Multiple Code Paths
Compiler macros
• Directly inside source code

• No runtime overhead

• Works with all build configurations
         #ifdef __i386__
                  strlcat(buf, "__i386__", sizeof(buf));
         #endif
         #ifdef __arm__
                  strlcat(buf, "__arm__", sizeof(buf));
         #endif
         #ifdef _MIPS_ARCH
                  strlcat(buf, "_MIPS_ARCH", sizeof(buf));
         #endif

                                                                                            source.c




                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners.
Multiple Code Paths
Make system
• Make system will select source file depending on
  architecture

• No runtime overhead

       arch_x86.cpp
       const char *getTarget ();


       arch_arm.cpp                             arch.h                                         cpufeaturestest.cpp
       const char *getTarget ();                const char *getTarget ();                      printf(“%s”, getTarget());

       arch_default.cpp
       const char *getTarget ();




                                         Copyright© 2012, Intel Corporation. All rights reserved.
                                   *Other brands and names are the property of their respective owners.
Multiple Code Paths
Cpufeatures API
• Checks for architecture and
  special CPU features

• Uses compiler macros +
  runtime detection internally
 • Small runtime overhead




                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Porting Native (C/C++) Android* Apps to x86

http://software.intel.com/en-us/articles/ndk-android-application-porting-
methodologies/

            Native Apps
• Optimized NDK for Intel Atom based
  devices available on
  http://developer.android.com/sdk/nd
  k/index.html since July’11.
• For most apps, changing the make
  file and a recompile should be
  sufficient to port to Intel Atom
  devices.
• If ARM-specific features are used,
  Intel SSE equivalents should be
  added (build flag)
• Developer recompiles, re-packages
  and publishes.



                                  Copyright© 2012, Intel Corporation. All rights reserved.
                            *Other brands and names are the property of their respective owners.
ARM* NEON to Intel® SSE

• Single Instruction Multiple Data (SIMD)

• Most ARM NEON functions have a 1:1 equivalent in
  Intel® SSE

• Intel provides C++ header file to do the mapping
        // VADD.I8 d0,d0,d0
 int8x8_t    vadd_s8(int8x8_t a, int8x8_t b);
 #ifdef USE_MMX
        #define vadd_s8 _mm_add_pi8   //MMX
 #else
        #define vadd_s8 _mm_add_epi8
 #endif

                                                                                          neonvssse.h


                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Differences between ARM and x86
Alignment
• ARM uses aligned, x86 uses packed memory

  struct TestStruct
                                                                           ARM
  {
     int mVar1;
     long long mVar2;
     int mVar3;
  };
                                                                            x86




• Compiler parameter helps to workaround
  -malign-double




                              Copyright© 2012, Intel Corporation. All rights reserved.
                        *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Market
Fat binary
• Include all binaries into one apk
                                                libs/armeabi
       Source


                 ndk-build                                                         apkbuilder

                                              libs/armeabi-
                                                    v7a                                         …



                                                    libs/x86




• Device removes incompatible libs at installation

                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Market
Multiple APKs
• Support for different …
 • Texture formats
 • Screen sizes and densities
 • Platform versions
 • CPU architectures

• Saves bandwidth and space while installation




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Conclusion & Call to action

• NDK provides plenty of mechanisms to
  differentiate between architectures

• Recompile your NDK based app with
  APP_ABI := all




                      Copyright© 2012, Intel Corporation. All rights reserved.
                *Other brands and names are the property of their respective owners.
21
Legal Disclaimer & Optimization Notice

        INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY
        ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS
        DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR
        IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES
        RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY
        PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

        Software and workloads used in performance tests may have been optimized for performance only on
        Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using
        specific computer systems, components, software, operations and functions. Any change to any of
        those factors may cause the results to vary. You should consult other information and performance
        tests to assist you in fully evaluating your contemplated purchases, including the performance of that
        product when combined with other products.

        Copyright © , Intel Corporation. All rights reserved. Intel, the Intel logo, Xeon, Core, VTune, and Cilk
        are trademarks of Intel Corporation in the U.S. and other countries.


             Optimization Notice
             Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that
             are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and
             other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on
             microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended
             for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for
             Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information
             regarding the specific instruction sets covered by this notice.
                                                                                                          Notice revision #20110804


22                                                                  Intel Confidential
                                                      Copyright© 2012, Intel Corporation. All rights reserved.
17.04.2013                                      *Other brands and names are the property of their respective owners.
Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel

Weitere ähnliche Inhalte

Was ist angesagt?

Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013Intel Software Brasil
 
EclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soupEclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soupBruce Griffith
 
Droid con 2012 bangalore v2.0
Droid con 2012   bangalore v2.0Droid con 2012   bangalore v2.0
Droid con 2012 bangalore v2.0Premchander Rao
 
Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012Kazunori Sato
 
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...jaxLondonConference
 
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning AccelerationclCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning AccelerationIntel® Software
 
Open source hardware and the web
Open source hardware and the webOpen source hardware and the web
Open source hardware and the webada fruit
 
резников дмитрий
резников дмитрийрезников дмитрий
резников дмитрийapps4allru
 
HSA Introduction Hot Chips 2013
HSA Introduction  Hot Chips 2013HSA Introduction  Hot Chips 2013
HSA Introduction Hot Chips 2013HSA Foundation
 
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...Perforce
 
Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience National Cheng Kung University
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX OverviewYoss Cohen
 
Intel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom ProcessorIntel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom ProcessorIşınsu Akçetin
 
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler CollectionIntel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler CollectionDESMOND YUEN
 
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversKernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversAnne Nicolas
 

Was ist angesagt? (20)

Accelerated Android Development with Linaro
Accelerated Android Development with LinaroAccelerated Android Development with Linaro
Accelerated Android Development with Linaro
 
Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013
 
EclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soupEclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soup
 
Droid con 2012 bangalore v2.0
Droid con 2012   bangalore v2.0Droid con 2012   bangalore v2.0
Droid con 2012 bangalore v2.0
 
Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012
 
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
 
Nvidia Cuda Apps Jun27 11
Nvidia Cuda Apps Jun27 11Nvidia Cuda Apps Jun27 11
Nvidia Cuda Apps Jun27 11
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning AccelerationclCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
 
Open source hardware and the web
Open source hardware and the webOpen source hardware and the web
Open source hardware and the web
 
резников дмитрий
резников дмитрийрезников дмитрий
резников дмитрий
 
HSA Introduction Hot Chips 2013
HSA Introduction  Hot Chips 2013HSA Introduction  Hot Chips 2013
HSA Introduction Hot Chips 2013
 
Understanding open max il
Understanding open max ilUnderstanding open max il
Understanding open max il
 
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
 
Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience
 
ARM
ARMARM
ARM
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX Overview
 
Intel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom ProcessorIntel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom Processor
 
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler CollectionIntel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
 
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversKernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
 

Andere mochten auch

Microwave Devices Lecture08
Microwave Devices Lecture08Microwave Devices Lecture08
Microwave Devices Lecture08Amr Al-Awamry
 
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...Mikhail Vink
 
DIC_video_coding_standards_07
DIC_video_coding_standards_07DIC_video_coding_standards_07
DIC_video_coding_standards_07aniruddh Tyagi
 
A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01Marco Lisi
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Ibtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesIbtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesZakaria Zubi
 
Reborn Digital: coding text
Reborn Digital: coding textReborn Digital: coding text
Reborn Digital: coding textPip Willcox
 
Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google castDroidcon Berlin
 

Andere mochten auch (9)

Microwave Devices Lecture08
Microwave Devices Lecture08Microwave Devices Lecture08
Microwave Devices Lecture08
 
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
 
DIC_video_coding_standards_07
DIC_video_coding_standards_07DIC_video_coding_standards_07
DIC_video_coding_standards_07
 
A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
Ibtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesIbtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital images
 
crashing in style
crashing in stylecrashing in style
crashing in style
 
Reborn Digital: coding text
Reborn Digital: coding textReborn Digital: coding text
Reborn Digital: coding text
 
Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google cast
 

Ähnlich wie Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel

[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...BeMyApp
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetupBeMyApp
 
Android on IA devices and Intel Tools
Android on IA devices and Intel ToolsAndroid on IA devices and Intel Tools
Android on IA devices and Intel ToolsXavier Hallade
 
Arm based controller - basic bootcamp
Arm based controller - basic bootcampArm based controller - basic bootcamp
Arm based controller - basic bootcampRoy Messinger
 
NFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function FrameworkNFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function FrameworkMichelle Holley
 
Open CL For Speedup Workshop
Open CL For Speedup WorkshopOpen CL For Speedup Workshop
Open CL For Speedup WorkshopOfer Rosenberg
 
Android NDK and the x86 Platform
Android NDK and the x86 PlatformAndroid NDK and the x86 Platform
Android NDK and the x86 PlatformSebastian Mauer
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterTim Ellison
 
Intel® Graphics Performance Analyzers
Intel® Graphics Performance AnalyzersIntel® Graphics Performance Analyzers
Intel® Graphics Performance AnalyzersIntel® Software
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Intel® Software
 
Using LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowUsing LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowDataWorks Summit
 
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Intel® Software
 
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel Software Brasil
 
Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...BeMyApp
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boardsLF Events
 
The Role of Standards in IoT Security
The Role of Standards in IoT SecurityThe Role of Standards in IoT Security
The Role of Standards in IoT SecurityHannes Tschofenig
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughBenjamin Zores
 
Velocity-EHF for Android
Velocity-EHF for AndroidVelocity-EHF for Android
Velocity-EHF for Androidmichaeljfawcett
 

Ähnlich wie Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel (20)

[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetup
 
Android on IA devices and Intel Tools
Android on IA devices and Intel ToolsAndroid on IA devices and Intel Tools
Android on IA devices and Intel Tools
 
Arm based controller - basic bootcamp
Arm based controller - basic bootcampArm based controller - basic bootcamp
Arm based controller - basic bootcamp
 
NFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function FrameworkNFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function Framework
 
Open CL For Speedup Workshop
Open CL For Speedup WorkshopOpen CL For Speedup Workshop
Open CL For Speedup Workshop
 
Android NDK and the x86 Platform
Android NDK and the x86 PlatformAndroid NDK and the x86 Platform
Android NDK and the x86 Platform
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
 
Intel® Graphics Performance Analyzers
Intel® Graphics Performance AnalyzersIntel® Graphics Performance Analyzers
Intel® Graphics Performance Analyzers
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
 
Using LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowUsing LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache Arrow
 
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
 
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
 
Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...
 
E.s unit 6
E.s unit 6E.s unit 6
E.s unit 6
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boards
 
The Role of Standards in IoT Security
The Role of Standards in IoT SecurityThe Role of Standards in IoT Security
The Role of Standards in IoT Security
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting Walkthrough
 
Velocity-EHF for Android
Velocity-EHF for AndroidVelocity-EHF for Android
Velocity-EHF for Android
 
ARM Processor Tutorial
ARM Processor Tutorial ARM Processor Tutorial
ARM Processor Tutorial
 

Mehr von Droidcon Berlin

Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility Droidcon Berlin
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_backDroidcon Berlin
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86Droidcon Berlin
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building AndroidDroidcon Berlin
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentationDroidcon Berlin
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Droidcon Berlin
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkraussDroidcon Berlin
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014Droidcon Berlin
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidconDroidcon Berlin
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devicesDroidcon Berlin
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradioDroidcon Berlin
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon Berlin
 
Droidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenbergDroidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenbergDroidcon Berlin
 
Droidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedekeDroidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedekeDroidcon Berlin
 
Droidcon2013 app analytics_huber_1und1
Droidcon2013  app analytics_huber_1und1Droidcon2013  app analytics_huber_1und1
Droidcon2013 app analytics_huber_1und1Droidcon Berlin
 

Mehr von Droidcon Berlin (20)

Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility
 
Details matter in ux
Details matter in uxDetails matter in ux
Details matter in ux
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_back
 
droidparts
droidpartsdroidparts
droidparts
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86
 
5 tips of monetization
5 tips of monetization5 tips of monetization
5 tips of monetization
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentation
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkrauss
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidcon
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradio
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicro
 
Droidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenbergDroidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenberg
 
Droidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedekeDroidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedeke
 
Droidcon2013 app analytics_huber_1und1
Droidcon2013  app analytics_huber_1und1Droidcon2013  app analytics_huber_1und1
Droidcon2013 app analytics_huber_1und1
 

Kürzlich hochgeladen

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Kürzlich hochgeladen (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel

  • 1. Optimizing NDK projects for multiple CPU architectures Alexander Weggerle Technical Consultant Engineer Intel Software and Services Group
  • 2. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 3. Introduction • Performance critical apps are popular • Games • Real time multimedia • Augmented reality • Users are sensitive • Don’t accept lags • Fluid animations • Minimal load time Optimization is important Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 4. Compatibility “I want my app to run on all architectures” • You already done for Java & HTML • NDK based apps usually just needs a recompilation APP_ABI := all Application.mk Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 5. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 6. Target compiler options • NDK-build system Android.mk file evaluated for each architecture • Variable TARGET_ARCH_ABI describes actual architecture TARGET_ARCH_ABI ifeq ($(TARGET_ARCH_ABI),x86) LOCAL_CFLAGS := -mtune=atom -mssse3 x86 endif armeabi ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) LOCAL_CFLAGS := -march=armv7-a armeabi-v7a Endif mips Android.mk Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 7. Recommended Compiler options (x86) • -mtune=atom • Out of Order scheduling • -march=atom • movbe instruction • Code is only guaranteed to run on Atom. – Might not run on emulator or other CPUs • -ansi-alias / -restrict / -no-prec-div Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 8. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 9. Multiple Code Paths • Different reasons for multiple code paths • Optimizing for multiple architectures • Single Instruction Multiple Data (SIMD) • Assembly kernels • Memory alignment • Instruction set support Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 10. Multiple Code Paths Compiler macros • Directly inside source code • No runtime overhead • Works with all build configurations #ifdef __i386__ strlcat(buf, "__i386__", sizeof(buf)); #endif #ifdef __arm__ strlcat(buf, "__arm__", sizeof(buf)); #endif #ifdef _MIPS_ARCH strlcat(buf, "_MIPS_ARCH", sizeof(buf)); #endif source.c Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 11. Multiple Code Paths Make system • Make system will select source file depending on architecture • No runtime overhead arch_x86.cpp const char *getTarget (); arch_arm.cpp arch.h cpufeaturestest.cpp const char *getTarget (); const char *getTarget (); printf(“%s”, getTarget()); arch_default.cpp const char *getTarget (); Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 12. Multiple Code Paths Cpufeatures API • Checks for architecture and special CPU features • Uses compiler macros + runtime detection internally • Small runtime overhead Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 13. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 14. Porting Native (C/C++) Android* Apps to x86 http://software.intel.com/en-us/articles/ndk-android-application-porting- methodologies/ Native Apps • Optimized NDK for Intel Atom based devices available on http://developer.android.com/sdk/nd k/index.html since July’11. • For most apps, changing the make file and a recompile should be sufficient to port to Intel Atom devices. • If ARM-specific features are used, Intel SSE equivalents should be added (build flag) • Developer recompiles, re-packages and publishes. Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 15. ARM* NEON to Intel® SSE • Single Instruction Multiple Data (SIMD) • Most ARM NEON functions have a 1:1 equivalent in Intel® SSE • Intel provides C++ header file to do the mapping // VADD.I8 d0,d0,d0 int8x8_t vadd_s8(int8x8_t a, int8x8_t b); #ifdef USE_MMX #define vadd_s8 _mm_add_pi8 //MMX #else #define vadd_s8 _mm_add_epi8 #endif neonvssse.h Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 16. Differences between ARM and x86 Alignment • ARM uses aligned, x86 uses packed memory struct TestStruct ARM { int mVar1; long long mVar2; int mVar3; }; x86 • Compiler parameter helps to workaround -malign-double Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 17. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 18. Market Fat binary • Include all binaries into one apk libs/armeabi Source ndk-build apkbuilder libs/armeabi- v7a … libs/x86 • Device removes incompatible libs at installation Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 19. Market Multiple APKs • Support for different … • Texture formats • Screen sizes and densities • Platform versions • CPU architectures • Saves bandwidth and space while installation Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 20. Conclusion & Call to action • NDK provides plenty of mechanisms to differentiate between architectures • Recompile your NDK based app with APP_ABI := all Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 21. 21
  • 22. Legal Disclaimer & Optimization Notice INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. Copyright © , Intel Corporation. All rights reserved. Intel, the Intel logo, Xeon, Core, VTune, and Cilk are trademarks of Intel Corporation in the U.S. and other countries. Optimization Notice Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 22 Intel Confidential Copyright© 2012, Intel Corporation. All rights reserved. 17.04.2013 *Other brands and names are the property of their respective owners.