Testing for Stage II for Project

Hi Everyone, I am writing this blog in continuity of my previous blog about Project Stage II. You can read my previous blog on this link.

In this blog I am going to demonstrate how to use the tool and test it.

You can get the tool from https://github.com/NishanSingh6/SPO600-Project.

But before using this tool please read the following conditions and limitations of using this tool at its current version which is v1.0.

Limitations:

This is initial implementation of the tool, due to which it have several bugs and limitations. I will fix these limitations and bugs in the final version of the tool in Stage III of project. Following are the limitations and conditions:
  • The very first limitation of the tool is that is accepts only two arguments. First argument must be main.c file and second argument must be .c file which contains the function which needs to be vectorized. This tool does not have proper exception handling or any input data validation, due to which if any arguments are invalid or they are in wrong order or second argument does not contains the single function then this tool will break and will not work properly.
  • The second and most important limitation of the tool is that for now it only accepts the function with name "adjust_channels". The function which needs to be vectorized must be named adjust_channels. This tool will work only if function which needs to vectorized is void, it does not return anything. If second argument does not contain the function with name adjust_channels then the tool will not work properly. 
  • The third major limitation of the tool is that arguements of function which needs to be vectorized (adjust_channels for now) should be only built-in data types. These should not contain any user-defined data types such as structs or classes.
  • Other than these, this tool has some minor bugs along with permitted limitations. These permitted limitations are described in my previous blog, you can find my previous blog on this link.
If these conditions are met properly then this tool will run properly and create the binary output file along with above described deliverables.

How to use:

This tool will run only on AArch64 systems. Firstly use the following command to clone the tool.

git clone https://github.com/NishanSingh6/SPO600-Project
By using following command files will be copied.


A New Directory with name SPO600-Project will created this directory will include tool.py and template.txt. Do not alter the content of any file.

By moving in the directory you can use the tool by using following command.

python tool.py arg1 arg2
Here arg1 is the main.c, and arg2 is filename of the file which contains the function which will be vectorized.

Before testing it, lets clone the testing directory provided by professor, this directory contains all the file needed.

You can run the following command to clone the director:
git clone https://github.com/ctyler/spo600-fall2022-project-test-code
This will create the new directory with name spo600-fall2022-project-test-code.
First rename the directory to something simple such as test.

After cloning both directories copy the tool.py and template.txt to test. you can do it using following code
cp SPO600-Project/* test/
After copying the file go to test directory and double check that all the files are in the same directory, these must be in the same directory in order tool to work.

Then run the following command to use the tool
python tool.py main.c function.c
This will run the tool, and tool will build all the files and link them to generate the main output binary file. You will notice it will take some time to link all output files but after this many files will be created. You can learn about each of those file in my previous blog.


Here main is the file binary output file. 
To test it we can run the following command.
./main /tests/input/bree.jpg 1.0 1.0 1.0 /tests/output/bree.jpg


As I am using israel.cdot.systems as my system which does not support SVE, We can qemu-aarch64 to run the emulator. By adding it before the previous command we can see this time it will use sve2 implementation.


By following above given instruction you can test the tool.
I will update its features and overcome the limitations and fix bugs for the stage 3. 


Comments

Popular posts from this blog

Review of 2 Open Source Softwares

Final Implementation of SPO600 Project - Stage III