Skip to content
Snippets Groups Projects
Commit 144ec2f4 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Fixing LLVM_SRC_ROOT asseertions in approx knob handling

parent 3f09f978
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
#include <string.h>
#include "approx_knob_utils.h"
#include "debug.h"
PerfParams::PerfParams(){
......@@ -25,16 +25,15 @@ PerfParams::PerfParams(int row1, int col1, int skip_offset1){
PerfParamSet::PerfParamSet(){
char llvm_src_root[100];
strcpy(llvm_src_root, getenv("LLVM_SRC_ROOT"));
if (llvm_src_root == NULL){
char* env_str= getenv("LLVM_SRC_ROOT");
printf("ERROR: SET LLVM_SRC_ROOT \n");
abort();
if (env_str == NULL){
ERROR("ERROR: SET LLVM_SRC_ROOT \n");
}
strcpy(llvm_src_root, env_str);
printf ("*LLVM_SRC_ROOT = %s", llvm_src_root);
char* knobs_file_path = strcat(llvm_src_root, "/projects/hpvm-tensor-rt/autotuner/data/global_knobs.txt");
......@@ -48,8 +47,7 @@ PerfParamSet::PerfParamSet(){
while(std::getline(file, line)) { // Read each line
printf ("***** line === ", line);
//printf ("***** line === %s ", line);
std::istringstream iss(line);
std::string token;
while(std::getline(iss, token, '\t')){ // Read each token in the line
......@@ -118,14 +116,13 @@ SampParams::SampParams(int skip_rate1, int skip_offset1, float interpolation_id1
SampParamSet::SampParamSet(){
char llvm_src_root[100];
strcpy(llvm_src_root, getenv("LLVM_SRC_ROOT"));
if (llvm_src_root == NULL){
char* env_str= getenv("LLVM_SRC_ROOT");
printf("ERROR: SET LLVM_SRC_ROOT \n");
abort();
if (env_str == NULL){
ERROR("ERROR: SET LLVM_SRC_ROOT \n");
}
strcpy(llvm_src_root, env_str);
printf ("* LLVM_SRC_ROOT = %s \n", llvm_src_root);
char* knobs_file_path = strcat(llvm_src_root, "/projects/hpvm-tensor-rt/autotuner/data/global_knobs.txt");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment