diff --git a/llvm/projects/hpvm-tensor-rt/dnn_sources/src/unit_tests.cc b/llvm/projects/hpvm-tensor-rt/dnn_sources/src/unit_tests.cc index 95b571e5a0d710cf71f0bb714e658420751abf53..bde9a0cacec7566df3859be0ac3d51f75a30b7cc 100644 --- a/llvm/projects/hpvm-tensor-rt/dnn_sources/src/unit_tests.cc +++ b/llvm/projects/hpvm-tensor-rt/dnn_sources/src/unit_tests.cc @@ -2,10 +2,8 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> - #include "tensor_runtime.h" #include "utils.h" - #include "tensor_custom_ops_cpu.h" @@ -59,40 +57,10 @@ void testTensorHgemm(){ void* output = tensorHalfGemm(lhs, rhs); printTensorValues(output); - void* bias_ptr = create4DTensor(CUDNN_TENSOR_NCHW, CUDNN_DATA_FLOAT, 1, 3, 1, 1); - struct Tensor* bias = (struct Tensor*) bias_ptr; - fillTensorWithOnes(bias); - - float* bias_arr = (float*) bias->host_data; - for(int i = 0; i < bias->num_elems; i++){ - bias_arr[i] = i + 1; - } - - void* output2 = tensorAdd(output, bias); - printTensorValues(output2); + // TODO: Add result comparator - Make a generic result comparator } -void testTensorHgemm2(){ - - printf("***** TensorHgemm ***** \n\n"); - void* lhs_ptr = create4DTensor(CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW, - 10000, 800, 1, 1); - struct Tensor* lhs = (struct Tensor*) lhs_ptr; - - float* data_arr = (float*) lhs->host_data; - for(int i = 0; i < lhs->num_elems; i++){ - data_arr[i] = (i / 4) + 1; - } - - void* rhs = create4DTensor(CUDNN_TENSOR_NCHW, CUDNN_DATA_FLOAT, - 1, 1, 800, 800); - fillTensorWithOnes(rhs); - - void* output = tensorHalfGemm(lhs, rhs); - //printTensorValues(output); -} - void testTensorSgemm2(){ @@ -1209,7 +1177,8 @@ int main(){ startProfiling(); - //testTensorHgemm2(); + testTensorHgemm(); + //testTensorSgemm2(); //testTensorConv(); //testTensorError(); @@ -1250,9 +1219,7 @@ int main(){ *************/ - testNewTensorOps(); - - + //testNewTensorOps(); //testQuantization();