Skip to content

sarahjums/MP2-lbyarch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A kernel in C and x86-64 Assembly that performs a dot product between vector A and vector B.

Performance of the Kernels (debug mode)

Each implementation was run 30 times for vector sizes n = 220, 224, and 230, and the average execution time was calculated. This includes a C version and an x86-64 assembly language version.

C Kernel (cfunc.c file)

dot_prod_c(...)

n ave time
220 0.003267 sec
224 0.051800 sec
230 64.089600 sec

x86-64 Kernel (asmfunc.asm file)

dot_prod_asm(...)

n ave time
220 0.000967 sec
224 0.015400 sec
230 62.540967 sec

The x86-64 implementation had a lower average execution time than the C implementation for the dot product operation. This suggest that the x86-64 runs faster than the C implementation.

Correctness Check of Dot Product

Dot Product from C vs. Dot Product from x86-64

image

✔ produces the same results

NOTE: displayed times are an average from 30 consecutive runs

Performance of the Kernels (release mode)

C Kernel (cfunc.c file)

dot_prod_c(...)

n ave time
220 0.000933 sec
224 0.014800 sec
230 66.016167 sec

x86-64 Kernel (asmfunc.asm file)

dot_prod_asm(...)

n ave time
220 0.000933 sec
224 0.014533 sec
230 64.533533 sec

Similar to the trials performed in debug mode, the x86-64 implementation once again had a lower average execution time than the C implementation for the dot product operation. This further supports the idea that the x86-64 implementation is a better performing one.

Correctness Check of Dot Product

Dot Product from C vs. Dot Product from x86-64

image

✔ produces the same results

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published