diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/resnet18_cifar10_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/resnet18_cifar10_half.cc index db8081c6b06e3529d76b13d64f3d25691184024c..7ca01cd60e8c3d8cb1ce957f7016d2c492550537 100644 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/resnet18_cifar10_half.cc +++ b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/resnet18_cifar10_half.cc @@ -7,13 +7,12 @@ int main() { llvm_hpvm_initTensorRt(0); - std::string dir_prefix = - model_params_path + std::string("/resnet18_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - // void* input = readTrainedWeights(input_path.c_str(), 0, - // batch_size,3,32,32); - std::string labels_path = dir_prefix + std::string("labels.bin"); - // uint8_t* labels = readLabels(labels_path.c_str(), batch_size); + std::string dir_prefix = model_params_path + std::string("/resnet18_cifar10/"); + + std::string input_path = dir_prefix + std::string("test_input.bin"); + + std::string labels_path = dir_prefix + std::string("test_labels.bin"); + std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); void *conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0, 16, 3, 3, 3); @@ -237,9 +236,9 @@ int main() { void *var_95 = tensorHalfAdd(var_94, dense_1_b); void *var_96 = tensorSoftmax(var_95); - uint8_t *labels = readLabelsBatch(labels_path.c_str(), start, end); + uint32_t *labels = readLabelsBatch3(labels_path.c_str(), start, end); - float accuracy = computeAccuracy2(labels, batch_size, var_96); + float accuracy = computeAccuracy3(labels, var_96); final_accuracy += accuracy; freeBatchMemory(); diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet18_cifar10.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet18_cifar10.cc index a7355fb063b37a90ab04d077d1c1b32f26613857..dcd96119630d1bed0214966c127c83a6a29ac656 100644 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet18_cifar10.cc +++ b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet18_cifar10.cc @@ -1,19 +1,18 @@ -#include "../../tensor_runtime/include/tensor_runtime.h" -#include "../include/utils.h" +#include "../../../tensor_runtime/include/tensor_runtime.h" +#include "../../include/utils.h" int main() { - llvm_hpvm_initTensorRt(1); + llvm_hpvm_initTensorRt(0); - std::string dir_prefix = - model_params_path + std::string("/resnet18_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - // void* input = readTrainedWeights(input_path.c_str(), 0, - // batch_size,3,32,32); - std::string labels_path = dir_prefix + std::string("labels.bin"); - // uint8_t* labels = readLabels(labels_path.c_str(), batch_size); + std::string dir_prefix = model_params_path + std::string("/resnet18_cifar10/"); + + std::string input_path = dir_prefix + std::string("test_input.bin"); + + std::string labels_path = dir_prefix + std::string("test_labels.bin"); + std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); void *conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0, 16, 3, 3, 3); @@ -237,9 +236,9 @@ int main() { void *var_95 = tensorAdd(var_94, dense_1_b); void *var_96 = tensorSoftmax(var_95); - uint8_t *labels = readLabelsBatch(labels_path.c_str(), start, end); + uint32_t *labels = readLabelsBatch3(labels_path.c_str(), start, end); - float accuracy = computeAccuracy2(labels, batch_size, var_96); + float accuracy = computeAccuracy3(labels, var_96); final_accuracy += accuracy; freeBatchMemory();