Skip to content

Instantly share code, notes, and snippets.

View hsandid's full-sized avatar

Hadi Sandid hsandid

View GitHub Profile
@echo off
SETLOCAL
title OrganizeByExtension.bat
echo ---------------------------------------------------------------------------
echo Script : OrganizeByExtension.bat
echo Description : Organize files into different folders based on their extension
echo Note : Does not affect files in subdirectories
echo ---------------------------------------------------------------------------
for /f "tokens=* delims=" %%f in ('dir /b /a-d') do (

Arrow FYP - Update on Software Component

General Update

  • Progress has been made on porting tests from the MLPerf Inference Benchmark suite to C++.
  • I did not start working on the gem5 model yet. I plan to do so over the remainder of the winter break.

Porting ML Inference Algorithms from Python to C++.

Research :

.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "main.c"
.globl main # -- Begin function main
.p2align 1
.type main,@function
main: # @main
# %bb.0:
addi sp, sp, -160

Cross-Compilation Tutorial : C to RISC-V (+ Vector Extension)

To cross-compile C code to a RISC-V target, we need to following compiler toolchains :

  • EPI Fork of the LLVM/Clang Toolchain, which is modified to offer experimental support for RISC-V Vector instructions, as well as vector intrinsics which can be directly called in C code.

  • RISC-V GNU Toolchain, which is needed to supplement the missing library/include dependencies in the LLVM/Clang toolchain when cross-compiling.

Installation Instructions

Progress on the software side :

  • At first, we tried to use an experimental version of LLVM/Clang (the epi one) which offers vector intrinsics.

  • Issue is that it is going to change heavily, and probably try to adhere to an official standard for risc-v vector intrinsic link - Example of C API for Vector integer arithmetic operations link.

  • Interestingly, the RISC-V GNU/GCC toolchain has a branch focusing on developing riscv intrinsic. This branch respects the api agreed on above, and is going to be merged upstream soon when the risc-v vector extension spec v1.0 is released. link. I have pulled that branch and tried to write some programs -> it works well !

  • Very important question : we have previously decided to use LLVM/Clang over GNU/GCC, it might be interesting to tak

@hsandid
hsandid / main.c
Last active January 20, 2021 11:18
#include <stdio.h>
extern void sgemm_nn(size_t n, size_t m, size_t k, const int*a, size_t lda, const int*b, size_t ldb, int*c, size_t ldc);
int main()
{
int sum=0;
int matrix1[4][4]= {
{3,2,4,4},