Most Android phones these days use some form of ARM chip or multiple ARM chips. Using Android Studio and the NDK, it is possible to access and run some Neon instructions, which are a set of ARM...

1 answer below »

Most Android phones these days use some form of ARM chip or multiple ARM chips. Using Android Studio and the NDK, it is possible to access and run some Neon instructions, which are a set of ARM instructions aimed at optimising performance for applications such as audio/video digital signal processing. Using Android Studio, it is possible to profile code running on a connected phone or on a phone emulator. In this project, you will write some C code, run it and profile it. Then you will run equivalent code, except using Neon instructions and profile it. You will then analyse and discuss the results.




ARM Neon Experimentation with Android Studio Final Assignment 2020 Part I (b) – 10% Introduction Most Android phones these days use some form of ARM chip or multiple ARM chips. Using Android Studio and the NDK, it is possible to access and run some Neon instructions, which are a set of ARM instructions aimed at optimising performance for applications such as audio/video digital signal processing. Using Android Studio, it is possible to profile code running on a connected phone or on a phone emulator. In this project, you will write some C code, run it and profile it. Then you will run equivalent code, except using Neon instructions and profile it. You will then analyse and discuss the results. Install Android Studio 1. Install Android Studio and use default options a. Download from here: https://developer.android.com/studio Install Android NDK The NDK allows users to compile and debug native (C/C++) code to run on an Android App. 1. Follow these instructions to install the Android NDK: https://developer.android.com/studio/projects/install-ndk Download hello-neon 1. Download the hello-neon Android Studio project from GitHub a. https://github.com/android/ndk-samples Open and run hello-neon Project 1. Open Android Studio 2. Navigate to the hello-neon project 3. Follow this video for instructions on how to open the hello-neon project in Android Studio 4. When the project opens, open the helloneon.c file, as shown bellow 5. On line 112, make an edit to enter your student number, as shown below: 6. Build the project, by selecting from the toolbar Build -> Make Project, as shown below: 7. On the top of the IDE, just below the toolbar, select the Nexus 5X phone emulator. This is an emulator that simulates the hardware on a Nexus 5X. Using this, we do not need to connect an android phone. i. Bonus points for connecting up a phone and running the code on an actual phone. There is lots of online documentation on how to do this. ii. Hint: you will need to set your Android phone to “developer mode” 8. Hit “Run” to run the application You should see the simulated Nexus 5 pop up after 10-30 seconds, shown below: On the screen, you will see the length of time taken to process an FIR filter written in standard C vs the time taken for an equivalent filter written using Neon instructions. It also displays how much faster the Neon version is than the standard C version. 9. On line 61, change the #define FILTER_KERNAL_SIZE to 16 and reduce the number of filter coefficients to 16, as shown below: 10. Build and run the App with these modified parameters and record the two values: i. C version ii. Neon version 11. Change FIR_KERNEL_SIZE to 32 and coefficients to 32, build and run and record the C and Neon times again (see below). 12. Change FIR_KERNEL_SIZE to 48 and coefficients to 48, build and run and record the C and Neon times again (see below). 13. Repeat this procedure, increasing the FIR filter size by increments of 16, noting the C and Neon execution times until the filter (kernel) size reaches 512. So that will be 32 runs in total. 14. Plot a graph of C execution time (Y-axis) vs Filter Kernel Size (X-axis) 15. Plot a graph of Neon execution time vs Filter Kernel Size (X-axis) on the same graph as the C execution time above, so they can be compared. Use different colours for each, so they can be seen clearly. i. Use Microsoft Excel for this if possible. If you can’t do this, use graph paper. 16. Discuss your findings in no less than 200 words.
Answered 1 days AfterApr 22, 2021

Answer To: Most Android phones these days use some form of ARM chip or multiple ARM chips. Using Android Studio...

Ankit answered on Apr 23 2021
164 Votes
81636/81636_Graph.xlsx
14
        Filter Kernel Size         C execution time         Neon execution time
        16        74.55        165.75
        32        155.62        279.32
        48        240.02        392.7
    
    64        296.59        506.98
        80        369.99        619.37
        96        436.3        733.47
        112        501.86        857.41
        128        575.78        960.38
        144        645.35        1074.51
        160        719.47        1186.52
        176        791.52        1301.27
        192        858.25        1415.05
        208        938.92        1529.65
        224        1003.29        1642.32
        256        1067.81        1756.13
        272        1155.49        1873.42
        288        1200.21        1986.45
        304        1272.67        2099.94
        320        1352.88        2214.6
        336        1407.37        2328.59
        352        1493.18        2450.46
        368        1570.84        2556.7
        384        1624.52        2678.23
        400        1690.45        2783.48
        416        1755.28        2898.33
        432        1836.04        3012.74
        448        1907.23        3127.66
        464        1990.64        3240.29
        480        2039.61        3354.72
        496        2119.24        3468.11
        512        2177.43        3582.23
Filter Kernel Size     16    32    48    64    80    96    112    128    144    160    176    192    208    224    256    272    288    304    320    336    352    368    384    400    416    432    448    464    480    496    512    C execution time     74.55    155.62    240.02    296.58999999999997    369.99    436.3    501.86    575.78    645.35    719.47    791.52    858.25    938.92    1003.29    1067.81    1155.49    1200.21    1272.67    1352.88    1407.37    1493.18    1570.84    1624.52    1690.45    1755.28    1836.04    1907.23    1990.64    2039.61    2119.2399999999998    2177.4299999999998    Neon execution time     165.75    279.32    392.7    506.98    619.37    733.47    857.41    960.38    1074.51    1186.52    1301.27    1415.05    1529.65    1642.32    1756.13    1873.42    1986.45    2099.94    2214.6    2328.59    2450.46    2556.6999999999998    2678.23    2783.48    2898.33    3012.74    3127.66    3240.29    3354.72    3468.11    3582.23    
15
        Filter Kernel Size         Neon execution time...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here