From d805cb533bc342010cb1c5e8bb63ba53171b591a Mon Sep 17 00:00:00 2001
From: akashk4 <hashim.sharif91@gmail.com>
Date: Sat, 30 Jan 2021 16:59:29 -0600
Subject: [PATCH] Add descriptors for tensor runtime headers and implementation
 files

---
 .../tensor_runtime/include/tensor_cpu_runtime.h       | 11 +++++++++++
 .../tensor_runtime/include/tensor_signatures.cc       | 10 ++++++++++
 .../tensor_runtime/src/approx_simulation.cu           |  2 +-
 .../tensor_runtime/src/configuration.cpp              | 10 ++++++++++
 .../hpvm-tensor-rt/tensor_runtime/src/fp16_gemm.cu    | 10 +++++++++-
 .../hpvm-tensor-rt/tensor_runtime/src/group_conv.cu   | 10 ++++++++++
 .../tensor_runtime/src/wrapper_runtime.cu             |  9 +++++++++
 7 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_cpu_runtime.h b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_cpu_runtime.h
index 31214eaaa7..4bb703bbd2 100644
--- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_cpu_runtime.h
+++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_cpu_runtime.h
@@ -1,3 +1,14 @@
+//===--------------------------- tensor_cpu_runtime.h -----------------------===//
+//
+//===----------------------------------------------------------------------===//
+//   
+// This header file comprises of the API to the tensor routines for CPU.
+// This also contains the interfaces to the approximated versions of tensor
+// operations that are supported on CPU.
+//
+//===----------------------------------------------------------------------===//
+
+
 #include <stdio.h>
 #include <cstdlib>
 #include <cmath>
diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_signatures.cc b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_signatures.cc
index 7eb3afc62d..323adbac89 100644
--- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_signatures.cc
+++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_signatures.cc
@@ -1,3 +1,13 @@
+//===--------------------------- tensor_signatures.cc -----------------------===//
+//
+//===----------------------------------------------------------------------===//
+//   
+// This file contains the declarations of the API to the HPVM tensor runtime.
+// This is compiled to LLVM bitcode file that is loaded by HPVM passes when
+// tensor-based application are compiled through HPVM.
+//
+//===----------------------------------------------------------------------===//
+
 
 #include "tensor_runtime.h"
 
diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/approx_simulation.cu b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/approx_simulation.cu
index 9a3c9ca848..e9a4e50b00 100644
--- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/approx_simulation.cu
+++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/approx_simulation.cu
@@ -2,7 +2,7 @@
 //
 //===----------------------------------------------------------------------===//
 //   
-//  This file  consists of the simulation of implementation of software 
+//  This file  consists of the emulations of implementation of software 
 // approximations for tensor convolutions. The approximations implemented are 
 // feature sampling and perforation for FP32 and FP16 compute precisions.  
 //
diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/configuration.cpp b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/configuration.cpp
index d9d598d2a6..7b8865966f 100644
--- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/configuration.cpp
+++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/configuration.cpp
@@ -1,3 +1,13 @@
+//===--------------------------- configuration.cpp -------------------------===//
+//
+//===----------------------------------------------------------------------===//
+//   
+//  This file  consists of the definitions of API to get information about 
+// configurations for rest of the tensor runtime to use.
+//
+//===----------------------------------------------------------------------===//
+
+
 #include "configuration.h"
 
 using P_APPROX = PROMISENodeConfiguration::APPROX;
diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/fp16_gemm.cu b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/fp16_gemm.cu
index 1a42568784..4392839f7f 100644
--- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/fp16_gemm.cu
+++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/fp16_gemm.cu
@@ -1,4 +1,12 @@
-
+//===--------------------------- fp16_gemm.cu -----------------------------===//
+//
+//===----------------------------------------------------------------------===//
+//   
+//  This file  consists of the custom implementation of quantization kernels.
+// This helps HPVM to switch compute precision for tensor operations between
+// FP32 and FP16.
+//
+//===----------------------------------------------------------------------===//
 
 #ifndef FP16_UTILS_HEADER
 #define FP16_UTILS_HEADER
diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/group_conv.cu b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/group_conv.cu
index fd8a23b9ca..4b49a3702b 100644
--- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/group_conv.cu
+++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/group_conv.cu
@@ -1,3 +1,13 @@
+//===--------------------------- group_conv.cu -----------------------------===//
+//
+//===----------------------------------------------------------------------===//
+//   
+//  This file  group convolutions with FP16 and FP32 compute precisions. 
+// Note that group convolutions, unlike regular convolutions, are not
+// approximable in any other way in HPVM.
+//
+//===----------------------------------------------------------------------===//
+
 
 #include "tensor_utils.h"
 #include "fp16_gemm.h"
diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/wrapper_runtime.cu b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/wrapper_runtime.cu
index f9fee629e1..3f433be855 100644
--- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/wrapper_runtime.cu
+++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/wrapper_runtime.cu
@@ -1,3 +1,12 @@
+//===--------------------------- wrapper_runtime.cu -----------------------===//
+//
+//===----------------------------------------------------------------------===//
+//   
+// This file contains the implementation of some of the core API to tensor runtime
+// so that runtime tuning of approximations can be done on different targets.
+//
+//===----------------------------------------------------------------------===//
+
 
 #include <stdio.h>
 #include <cstdio>
-- 
GitLab