Giter VIP home page Giter VIP logo

lbyarch-mc02's Introduction

[LBYARCH] MC02

This repository contains requirements for our LBYARCH MC02

Requirements

Write the kernel in (1) C program and (2) an x86-64 assembly language.  The kernel is to perform a dot product between vector A and vector B and place the result in sdot.

Analysis

The following presents the average execution times for both the C and x86-64 programs across various vector sizes, ranging from 2^20 to 2^30 with an incremental exponent of 1.

Debug

In our initial debug mode attempt, we aimed to execute until an exponent of 30. However, upon reaching a vector size of 2^30, our system encountered a freeze, rendering the program unresponsive. Successful program execution was achieved when limiting the exponent to 29.

Below are the runtime results for debug mode: alt text

The ASM program exhibited around 30% faster execution compared to the C program.

Release

In release mode, similar to debug mode, we pursued execution until an exponent of 30. Again, similar to debug mode, the release mode operated smoothly up to a vector size of 2^29.

Below are the runtime results for release mode: alt text

Despite still outperforming the C program, the ASM program's execution in release mode showed a decrease in speed compared to debug mode, resulting in a narrower performance margin between the two programs. Interestingly, the C program demonstrated improved performance compared to its debug mode statistics.

Conclusion

The analysis above reveals how the ASM program consistently outperformed its C counterpart. Additionally, the ASM program ran faster in debug mode compared to its release mode couterpart, whilst the C program ran atleast 50% slower in debug mode compared to its release mode counterpart. This can be due to factors such as

  • ASM is a low level programming language, hence this allows programmers to manually allocate resources, resulting in highly optimized code
  • C is a high level programming language, wherein compilers are in charge of allocating resources.
  • Debug mode prioritizes correct functionality over performance, hence benefitting the ASM code as programmers can right straightforward, efficient code without the hassle of compiler optimizations.
  • The C program fared badly in debug mode as overhead, such as debug information, can impact run time. On the other hand, it ran faster in release mode due to compiler optimizations present in this mode.

lbyarch-mc02's People

Contributors

anaj00 avatar comfyjace avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.