From 95559150a1b0e19f4afa38cb3952e130afe7a0e8 Mon Sep 17 00:00:00 2001
From: Yifan Zhao <yifanz16@illinois.edu>
Date: Thu, 4 Feb 2021 01:37:41 -0600
Subject: [PATCH] Added llvm_hpvm_invokeRtControl to frontend-generated code

---
 hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm.cpp.in       | 3 +--
 .../torch2hpvm/torch2hpvm/template_hpvm_inspect.cpp.in         | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm.cpp.in b/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm.cpp.in
index d7fd6c8884..0c1db9b1ff 100644
--- a/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm.cpp.in
+++ b/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm.cpp.in
@@ -99,8 +99,7 @@ int main(int argc, char *argv[]){
     void *result = static_cast<RootIn*>(args)->r.tensor;
     hpvm_request_tensor(result, 0);
 
-    uint32_t* labels = readLabelsBatch3(labels_path.c_str(), start, end);
-    computeAccuracy3(labels, result);
+    llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end);
     freeBatchMemory();
   }
   __hpvm__cleanup();
diff --git a/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm_inspect.cpp.in b/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm_inspect.cpp.in
index d481da1944..178a6d28e9 100644
--- a/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm_inspect.cpp.in
+++ b/hpvm/projects/torch2hpvm/torch2hpvm/template_hpvm_inspect.cpp.in
@@ -139,8 +139,7 @@ int main(int argc, char *argv[]){
       void *result = static_cast<RootIn*>(args)->r.tensor;
       hpvm_request_tensor(result, 0);
 
-      uint32_t* labels = readLabelsBatch3(labels_path.c_str(), start, end);
-      computeAccuracy3(labels, result);
+      llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end);
       freeBatchMemory();
     }
     __hpvm__cleanup();
-- 
GitLab