diff --git a/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet/src/alexnet_loop.cpp b/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet/src/alexnet_loop.cpp index a62b2ea33ad7cc2838e68965e2ce19f615555b93..82dfcb725b6e69f49a4fef88037c544dcf257ed1 100644 --- a/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet/src/alexnet_loop.cpp +++ b/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet/src/alexnet_loop.cpp @@ -445,32 +445,37 @@ int main(){ startMemTracking(); startProfiling(); - for (int i = 0; i < batch_count; i++){ + for (int j = 0; j < 14; j++){ + for (int i = 0; i < batch_count; i++){ + + int start = i * batch_size; + int end = (i + 1) * batch_size; - int start = i * batch_size; - int end = (i + 1) * batch_size; - - // copyInputBatch(input_path.c_str(),start,end,3,32,32, input); - - // Replaced create4DTensor and copyInputBatch with readInputBatch - void* input = readInputBatch(input_path.c_str(), 0, - start, end, - 3, 32, 32); - - args->input = input; - args->input_bytes = 0; + // copyInputBatch(input_path.c_str(),start,end,3,32,32, input); - void* dfg = __visc__launch(0, root, (void*) args); - - __visc__wait(dfg); + // Replaced create4DTensor and copyInputBatch with readInputBatch + void* input = readInputBatch(input_path.c_str(), 0, + start, end, + 3, 32, 32); + + args->input = input; + args->input_bytes = 0; + + void* dfg = __visc__launch(0, root, (void*) args); - void *result = static_cast<RootIn*>(args)->input; - hpvm_request_tensor(result, 0); + __visc__wait(dfg); + + void *result = static_cast<RootIn*>(args)->input; + hpvm_request_tensor(result, 0); + + llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); - llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); + freeBatchMemory(); + } - freeBatchMemory(); } + + stopProfiling(); __visc__cleanup(); diff --git a/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet2/src/alexnet2_loop.cpp b/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet2/src/alexnet2_loop.cpp index e3c06325a67e648da47f710c72498308da1041be..956f8fbe8be788a9e387a9ff8937775a8bcf8707 100644 --- a/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet2/src/alexnet2_loop.cpp +++ b/llvm/test/VISC/DNN_Benchmarks/benchmarks/alexnet2/src/alexnet2_loop.cpp @@ -496,31 +496,35 @@ int main(){ startMemTracking(); startProfiling(); - for (int i = 0; i < batch_count; i++){ - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - // copyInputBatch(input_path.c_str(),start,end,3,32,32, input); - - void* input = readInputBatch(input_path.c_str(), 0, - start, end, - 3, 32, 32); - - args->input = input; - args->input_bytes = 0; - - void* dfg = __visc__launch(0, root, (void*) args); - - __visc__wait(dfg); - - void *result = static_cast<RootIn*>(args)->input; - hpvm_request_tensor(result, 0); + for (int j = 0; j < 14; j++){ + for (int i = 0; i < batch_count; i++){ + + int start = i * batch_size; + int end = (i + 1) * batch_size; + + // copyInputBatch(input_path.c_str(),start,end,3,32,32, input); + + void* input = readInputBatch(input_path.c_str(), 0, + start, end, + 3, 32, 32); + + args->input = input; + args->input_bytes = 0; + + void* dfg = __visc__launch(0, root, (void*) args); + + __visc__wait(dfg); + + void *result = static_cast<RootIn*>(args)->input; + hpvm_request_tensor(result, 0); + + llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); + + freeBatchMemory(); + } - llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); - - freeBatchMemory(); } + stopProfiling(); __visc__cleanup(); diff --git a/llvm/test/VISC/DNN_Benchmarks/benchmarks/resnet18/src/resnet18_loop.cpp b/llvm/test/VISC/DNN_Benchmarks/benchmarks/resnet18/src/resnet18_loop.cpp index 4c91f0e6619558d30f3819a6161fb73e5b6aaf7f..c65c6b5a774d1a8c46b746cbd7afda4cb705ae1b 100644 --- a/llvm/test/VISC/DNN_Benchmarks/benchmarks/resnet18/src/resnet18_loop.cpp +++ b/llvm/test/VISC/DNN_Benchmarks/benchmarks/resnet18/src/resnet18_loop.cpp @@ -1436,33 +1436,36 @@ int main(){ startMemTracking(); startProfiling(); - for (int i = 0; i < batch_count; i++){ - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - //copyInputBatch(input_path.c_str(),start,end,3,32,32, input); - - // NOTE-HASHIM: Commented out above line and line that does create4DTensor - void* input = readInputBatch(input_path.c_str(), 0, - start, end, - 3, 32, 32); - - args->input = input; - args->input_bytes = 0; - - void* dfg = __visc__launch(0, root, (void*) args); - - __visc__wait(dfg); - - void *result = static_cast<RootIn*>(args)->input; - hpvm_request_tensor(result, 0); - - llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); + for (int j = 0; j < 14; j++){ + for (int i = 0; i < batch_count; i++){ + + int start = i * batch_size; + int end = (i + 1) * batch_size; + + //copyInputBatch(input_path.c_str(),start,end,3,32,32, input); + + // NOTE-HASHIM: Commented out above line and line that does create4DTensor + void* input = readInputBatch(input_path.c_str(), 0, + start, end, + 3, 32, 32); + + args->input = input; + args->input_bytes = 0; + + void* dfg = __visc__launch(0, root, (void*) args); + + __visc__wait(dfg); + + void *result = static_cast<RootIn*>(args)->input; + hpvm_request_tensor(result, 0); + + llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); + + printf("RUNNING BATCH = %d \n", i); + + freeBatchMemory(); + } - printf("RUNNING BATCH = %d \n", i); - - freeBatchMemory(); } stopProfiling(); diff --git a/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar10/src/vgg16_cifar10_loop.cpp b/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar10/src/vgg16_cifar10_loop.cpp index 770020438c8e5bccc47690b55eb4b179e48e2b7c..aa505131e1aa0a43df4d538c9f4dfbb3647eeb9a 100644 --- a/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar10/src/vgg16_cifar10_loop.cpp +++ b/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar10/src/vgg16_cifar10_loop.cpp @@ -979,7 +979,7 @@ int main(){ startMemTracking(); startProfiling(); - for (int j = 0; j < 10; j++){ + for (int j = 0; j < 14; j++){ for (int i = 0; i < batch_count; i++){ int start = i * batch_size; diff --git a/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar100/src/vgg16_cifar100_loop.cpp b/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar100/src/vgg16_cifar100_loop.cpp index 7bb78e07bb8d6bda27b961753c9ccf3771151863..ee5643a8d23344fb75163652f176a949bf904930 100644 --- a/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar100/src/vgg16_cifar100_loop.cpp +++ b/llvm/test/VISC/DNN_Benchmarks/benchmarks/vgg16_cifar100/src/vgg16_cifar100_loop.cpp @@ -979,28 +979,31 @@ int main(){ startMemTracking(); startProfiling(); - for (int i = 0; i < batch_count; i++) { - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - void* input = readInputBatch(input_path.c_str(), 0, - start, end, - 3, 32, 32); - - args->input = input; - args->input_bytes = 0; - - void* dfg = __visc__launch(0, root, (void*) args); - - __visc__wait(dfg); - - void *result = static_cast<RootIn*>(args)->input; - hpvm_request_tensor(result, 0); - - llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); + for (int j = 0; j < 14; j++){ + for (int i = 0; i < batch_count; i++) { + + int start = i * batch_size; + int end = (i + 1) * batch_size; + + void* input = readInputBatch(input_path.c_str(), 0, + start, end, + 3, 32, 32); + + args->input = input; + args->input_bytes = 0; + + void* dfg = __visc__launch(0, root, (void*) args); + + __visc__wait(dfg); + + void *result = static_cast<RootIn*>(args)->input; + hpvm_request_tensor(result, 0); + + llvm_hpvm_invokeRtControl(result, labels_path.c_str(), start, end); + + freeBatchMemory(); + } - freeBatchMemory(); } stopProfiling();