diff --git a/llvm/projects/hpvm-tensor-rt/CMakeLists.txt b/llvm/projects/hpvm-tensor-rt/CMakeLists.txt index d7bffa6b909b12d26b8dcb0840920834a1acb08e..832fbc25e20140896f58db1d93efdd6e0d677d33 100644 --- a/llvm/projects/hpvm-tensor-rt/CMakeLists.txt +++ b/llvm/projects/hpvm-tensor-rt/CMakeLists.txt @@ -36,7 +36,7 @@ link_directories($ENV{CUDNN_PATH} $ENV{CUDNN_PATH}/lib $ENV{CUDNN_PATH}/lib64) # Adding new rule for building a cuDNN runtime library -cuda_add_library(tensor_runtime tensor_runtime/src/tensor_runtime.cu tensor_runtime/src/half_precision_api.cu tensor_runtime/src/tensor_utils.cu tensor_runtime/src/fp16_gemm.cu tensor_runtime/src/debug.cc tensor_runtime/src/global_data.cc ) +cuda_add_library(tensor_runtime tensor_runtime/src/tensor_runtime.cu tensor_runtime/src/half_precision_api.cu tensor_runtime/src/tensor_utils.cu tensor_runtime/src/fp16_gemm.cu tensor_runtime/src/debug.cc tensor_runtime/src/global_data.cc tensor_runtime/src/approx_simulation.cu) cuda_add_cublas_to_target(tensor_runtime) # Adding new rule for building a cuDNN runtime library diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/approx_api.h b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/approx_api.h index 50438eb22cf3cbfb5fcad600a5e599ef2c1c6b29..a785917607aea47e9fdb3c322e13ede81bf83946 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/approx_api.h +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/approx_api.h @@ -74,4 +74,21 @@ extern "C"{ int row, int col, int skip_every, int skip_offset); + + void* PROMISE_Conv(void* input, float i_min, float i_max, + void* filter, float w_min, float w_max, + void* bias, float b_min, float b_max, + int conv_pad_h, int conv_pad_w, + int conv_stride_h, int conv_stride_w, + int pool_id, int pool_size, + int activation_id, // Relu, Tanh, ClipRelu + float out_min, float out_max, int swing); + + + void* PROMISE_FC(void* input, float i_min, float i_max, + void* weights, float w_min, float w_max, + void* bias, float b_min, float b_max, + int activation_id, + float out_min, float out_max, int swing); + } diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/debug.h b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/debug.h index e3d4f4331835eb6ba7dec42a554913691a0969d8..a847a827bfe6b9468ffcc6afc98e7c76471477f8 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/debug.h +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/debug.h @@ -8,6 +8,7 @@ #define ASSERT_FLAG // Sets assertions to true (opposite of NDEBUG macro) #include "tensor.h" +#include <sstream> #define FatalError(s) do { \ diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/profiling.h b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/profiling.h index 7075d51cd60b610379536ddaa1c2255a8fc68de0..70ae14ca82fcf4627b8f49a573b76bb407c91718 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/profiling.h +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/profiling.h @@ -17,6 +17,7 @@ #include <cuda_runtime.h> #include "global_data.h" +#include "debug.h" /***** Profiling routines ***/ diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/approx_simulation.h b/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/approx_simulation.cu similarity index 100% rename from llvm/projects/hpvm-tensor-rt/tensor_runtime/include/approx_simulation.h rename to llvm/projects/hpvm-tensor-rt/tensor_runtime/src/approx_simulation.cu diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/debug.cc b/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/debug.cc index d40e6e3dfb8fdddde35016d829e462cb2557643f..1b36039f2f65070f4110a34be534bf8f3d8ec1ae 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/debug.cc +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/debug.cc @@ -8,10 +8,11 @@ #define ASSERT_FLAG // Sets assertions to true (opposite of NDEBUG macro) #include "tensor.h" -#include "../include/debug.h" +#include "debug.h" #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <sstream> void INFO(const char* format, ...){