1 / 35

Android* on Intel platforms

Android* on Intel platforms. And what it means for you, developers. Agenda. And what it means for you, developers. Powering the next generation of smartphones and feature phones, tablets, wearables , and connected devices with leading-edge technologies. Tablet Product Roadmap …. 2013

salene
Télécharger la présentation

Android* on Intel platforms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android* on Intel platforms And what it means for you, developers.

  2. Agenda • And what it means for you, developers.

  3. Powering the next generation of smartphones and feature phones, tablets, wearables, and connected devices with leading-edge technologies

  4. Tablet Product Roadmap … 2013 IA Tablets ramping Samsung Galaxy Tab 3 on Clover Trail+Bay Trail-T Accelerating: ~25 wins & counting 2012 In the game Motorola Razr i w/ Medfield Windows 8 connected standby tablets TTM 2014 14nm Coming Soon “Cherry Trail” “Across the board Intel manages a huge advantage …The x86 power myth has been busted.” --Anandtech* 12/24/12 Z37xx Z25xx Z24xx Product timing aligned to year of introduction 1For performance details, see https://www-ssl.intel.com/content/www/us/en/benchmarks/atom/atom-tablet-z3770-infographic.html

  5. Smartphones with Intel Inside - 2012 Z2460 Orange* San Diego (UK) Orange* avec Intel Inside (FR) ZTE* Grand X IN Motorola* RAZR i Megafon* Mint Lava* Xolo X900 Lenovo* K800

  6. Smartphones with Intel Inside - 2013 Z2420 Z2560 Z2580 Lenovo* K900 – 5.5” Intel® Yolo ASUS Fonepad™ Note FHD - 6” Etisalat E-20* ZTE* Geek – 5” • Acer* Liquid C1 • … ZTE* Grand X2 In – 4.5”

  7. Tablets with Intel Inside - 2013 ASUS* MeMO Pad FHD 10” (Z2560) ASUS* Fonepad™7” (Z2420/Z2460) Samsung* Galaxy™ Tab 3 10.1” (Z2560) Dell Venue 7 and 8 Clover Trail Plus dual-core Atom chip

  8. Future Android* platforms based on Intel* Silvermont microarchitecture New 22nm tri-gate microarchitecture~3X more peak performance or ~5X lower power than previous Atom microarchitecture Intel® Atom™ Processor Z3000 Series (Bay Trail) Next Generation Tablets Merrifield Next Generation Smartphones

  9. Our devices are already fully compatible with established Android* ecosystem Android Runtime Dalvik Virtual Machine Core Libraries Most of the time, it just works ! • Android*Dalvik* apps • These will directly work, Dalvik has beenoptimized for Intel® platforms. • Android NDK apps • Most will run without any recompilation on consumer platforms. • Android NDK provides an x86 toolchain since 2011 • A simple recompile using the Android NDK yields the best performance • If there is specific processor dependent code, porting may be necessary

  10. What we are working on for Android* 64bit

  11. How to target multiple platforms (incl. x86) from NDK apps ?

  12. Configuring NDK Target ABIs If you have the source code of your native libraries, you can compile it for several CPU architectures by setting APP_ABI to all in the Makefile “jni/Application.mk”: APP_ABI=all Put APP_ABI=all inside Application.mk Run ndk-build… ARM v7alibs are built ARM v5 libs are built x86 libs are built mips libs are built The NDK will generate optimized code for all target ABIs You can also pass APP_ABI variable directly to ndk-build, and specify each ABI: ndk-build APP_ABI=x86

  13. Packaging APKs for Multiple CPU Architectures PSI PIDs TS Two options: • One package for all (“fat binary”) • Embed native libraries for each architecture in one APK • Easiest and preferred way to go • Multiple APKs • One APK per architecture • If you have good reasons to do so (i.e., your fat binary APK would be larger than 50MB)

  14. By default, an APK contains libraries for every supported ABIs. Fat Binaries Use lib/armeabi libraries libs/armeabi libs/armeabi-v7a Use lib/armeabi-v7a libraries libs/x86 Use lib/x86 libraries … APK file The application will be filtered during installation (after download)

  15. Multiple APKs Google Play* supports multiple APKs for the same application. What compatible APK will be chosen for a device entirely depends on the android:VersionCode Using this convention, the chosen APK will be the one that run best on the device:

  16. 3rd party libraries x86 support Game engines/libraries with x86 support: • Havok Anarchy SDK: android x86 target available • Unreal Engine 3: android x86 target available • Marmalade:android x86 target available • Cocos2Dx: set APP_ABI in Application.mk • FMOD: x86 lib already included, set ABIs in Application.mk • AppGameKit: x86 lib already included, set ABIs in Application.mk • libgdx: x86 lib available from nightly builds • … No x86 support but works on consumer devices: • Corona • Unity

  17. Porting processor specific code to x86 on Android*

  18. SIMD Instructions //******* definition sample ***************** int8x8_t vadd_s8(int8x8_t a, int8x8_t b);// VADD.I8 d0,d0,d0 #ifdef USE_MMX #define vadd_s8 _mm_add_pi8 //MMX #else #define vadd_s8 _mm_add_epi8 #endif //… Supplemental Streaming SIMD Extensions (SSSE) Intel® Streaming SIMD Extensions (Intel® SSE) NEON* instruction set on ARM* platforms MMX™, Intel® SSE, SSE2, SSE3, SSSE3 on Intel® Atom™ processor based platforms http://intel.ly/10JjuY4 - NEONvsSSE.h : wrap NEON functions and intrinsics to SSE3 – 100% covered

  19. Memory Alignment By default structTestStruct{ intmVar1; longlong mVar2; intmVar3; }; Easy fix structTestStruct{ intmVar1; longlong mVar2 __attribute__ ((aligned(8))); intmVar3; };

  20. Intel® Tools for Android* apps developers Most of our tools are relevant even if you’re not targeting x86 platforms!

  21. Faster Android*Emulation on Intel® Architecture Based Host PC Pre-built Intel® Atom™ Processor Images • Android*SDK manager has x86 emulation images built-in • To emulate an Intel Atom processor based Android phone, install the “Intel Atom x86 System Image” available in the Android SDK Manager Much Faster Emulation • Intel® Hardware Accelerated Execution Manager (Intel® HAXM) for Mac and Windows uses Intel® Virtualization Technology (Intel® VT) to accelerate Android emulator • Intel VT is already supported in Linux*by qemu -kvm Intel x86 Atom System Image Intel x86 Emulator Accelerator

  22. Intel® Threading Building Blocks (TBB) Open Source version available on: threadingbuildingblocks.org Licensed version available on: software.intel.com/en-us/intel-tbb • Specify tasks instead of manipulating threads • Intel® Threading Building Blocks (Intel® TBB) maps your logical tasks onto threads with full support for nested parallelism • Targets threading for scalable performance • Uses proven efficient parallel patterns • Uses work-stealing to support the load balance of unknown execution time for tasks • Open source and licensed versions available onLinux*, Windows*, Mac OS X*, Android*…

  23. Intel® TBB - Example #include <tbb/parallel_reduce.h> #include <tbb/blocked_range.h> doublegetPi(){ constintnum_steps=10000000; constdouble step =1./num_steps; doublepi =tbb::parallel_reduce( tbb::blocked_range<int>(0,num_steps),//Range double(0),//Value //function [&](consttbb::blocked_range<int>& r,doublecurrent_sum)->double{ for(size_t i=r.begin(); i!=r.end();++i){ doublex =(i+0.5)*step; current_sum+=4.0/(1.0+ x*x); } returncurrent_sum;// updated value of the accumulator }, [](double s1,double s2 ){//Reduction returns1+s2; } ); returnpi*step; } Calculating a part of Pi within the range r Lambda function with range and initial value as parm Defining a reduction function Computes reduction over a range Defining a one-dimensional range

  24. Intel®Graphics Performance Analyzers • Profiles performance and Power • Real-time charts of CPU, GPU and power metrics • Conduct real-time experiments with OpenGL-ES* (with state overrides) to help narrow down problems • Triage system-level performance with CPU, GPU and Power metrics • Available freely on intel.com/software/gpa

  25. Intel® Graphics Performance Analyzers Install APK, and connect to Host PC via adb Run Intel® GPA System Analyzer on development machine View Profile

  26. Intel® HTML5 Development Environment (XDK NEW) • Great tools for free • Convenient, cloud-based build tool lets you target all popular platforms & app stores • Write once, run anywhere; code once, debug once, publish everywhere • more on: html5dev-software.intel.com

  27. Other tools and libs for Android* • Intel IPP Preview • Intel Compiler

  28. Call to Action

  29. Backup

  30. Optimizing Android for Intel®Atom™ Processor-Based Devices We optimize web technologies such as HTML 5, WebKit and JavaScript† GPU & Video support for canvas operations Apps Apps Home Contacts Phone Browser … Extensive middleware development in imaging, media and DRM deliver compelling media experiences Application Framework SKIA and openGL optimizations Activity Manager Windows* Manager … Content Providers View System User Experience Package Manager Telephony Manager Resource Manager Location Manager Notification Manager Apply our extensive experience optimizing Java* to the Dalvik* VM Libraries Android* Runtime Core Libraries Surface Manager Media Framework SQLite Middleware Dalvik Virtual Machine OpenGL* ES FreeType WebKit SGL SSL libc … Drivers validated & optimized for power & memory footprint Memory Optimizations, AVI, DivX*, and ASF container types, WMV /VC-1 decoder. Live Streaming optimizations, HDMI and WiDI Extended Video Modes, Video Playback DRM Linux* Kernel Display Driver Camera Driver Flash Memory Driver Binder (IPC) Driver Operating System Enhanced debugging and logging IA assembly optimizations Keypad Driver WiFi Driver Audio Drivers Power Management †Based on third party validation and sampling of Android apps using specific computer systems and/or components and reflect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance and/or results.

  31. Components of TBB (version 4.2) Parallel algorithms parallel_for parallel_for_each parallel_reduce parallel_do parallel_scan parallel_pipeline & filters parallel_sort parallel_invoke Flow Graphs functional nodes(source, continue, function) buffering nodes(buffer, queue, sequencer) split/join nodesother nodes Ranges and partitioners Tasks & Task groups Task scheduler Synchronization primitives atomic operations mutexes : classic, recursive, spin, queuing rw_mutexes : spin, queuing Concurrent containers concurrent_hash_map concurrent_queue concurrent_bounded_queue concurrent_priority_queue concurrent_vector concurrent_unordered_map concurrent_unordered_set Thread Local Storage combinable enumerable_thread_specific flattened2d Memory allocators tbb_allocator, cache_aligned_allocator, scalable_allocator

  32. Intel® TBB – Integration #for including tbb in your project: include$(CLEAR_VARS) LOCAL_MODULE := tbb LOCAL_SRC_FILES := $(TBB_PATH)/lib/android/libtbb.so LOCAL_EXPORT_C_INCLUDES := $(TBB_PATH)/include include$(PREBUILT_SHARED_LIBRARY) #for calling tbb from your lib: LOCAL_CPP_FEATURES := rtti exceptions LOCAL_SHARED_LIBRARIES += tbb LOCAL_CFLAGS += -DTBB_USE_GCC_BUILTINS -std=c++11 Android.mk Application.mk APP_STL := gnustl_shared System.loadLibrary("gnustl_shared"); System.loadLibrary("tbb"); System.loadLibrary("YourLib"); Java

  33. Intel® TBB - Download GPLv2 with runtime exception available from threadingbuildingblocks.org/download : The commercial version with support is here: software.intel.com/en-us/intel-tbb

  34. Beacon Mountain Preview v0.5 Downloader and Installer for a common set of Android* tools from Intel and 3rd parties : • Intel Tools • Intel® Hardware Accelerated Execution Manager • Intel® Graphics Performance Analyzers System Analyzer • Intel® Integrated Performance Primitives Preview • Intel® Threading Building Blocks • Intel® Software Manager • Third-Party Tools • Google Android SDK (ADT Bundle) • Android NDK • Eclipse Integrated Development Environment • Android Design • Cygwin* (for Windows operating systems) Free download at http://intel.com/software/beaconmountain

  35. Intel®C++ Compiler for Android* • Available on http://software.intel.com/c-compiler-android • Based on Intel® C/C++ Compiler XE 13.0 for Linux* • Integrates into the Android* NDK as additional toolchain which can be used from the command-line • Supports Intel® Atom™ processor optimization • Free for now

More Related