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

Adding failing sampling test on 1*1 filters

parent 8c07a878
No related branches found
No related tags found
No related merge requests found
......@@ -546,11 +546,11 @@ void testPerforation(){
//printTensorValues(input);
void* res = tensorConvPerfCuda(input, filter, 0, 0, 1, 1, 1, 1, 2, 1, 0);
void* res = tensorConvPerfCuda(input, filter, 0, 0, 1, 1, 1, 1, 2, 1, 1);
printTensorValues(res);
void* res2 = tensorConvApproxHalf2(input, filter, 0, 0, 1, 1, 1, 1, 2, 1, 1, 0);
void* res2 = tensorConvApproxHalf2(input, filter, 0, 0, 1, 1, 1, 1, 2, 1, 1, 1);
//void* res2 = tensorConvPerfCuda(input, filter, 0, 0, 1, 1, 1, 1, 2, 1, 0);
......@@ -559,22 +559,67 @@ void testPerforation(){
printTensorValues(res2);
void* res3 = tensorConvApprox(input, filter, 0, 0, 1, 1, 1, 1, 3, 1, 1, 0);
void* res3 = tensorConvApprox(input, filter, 0, 0, 1, 1, 1, 1, 2, 1, 1, 1);
printTensorValues(res3);
//void* res4 = tensorConvPerfSim(input, filter, 0, 0, 1, 1, 1, 1, 2, 1);
//void* res4 = tensorConvApprox(input, filter, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0);
//printTensorValues(res4);
//printTensorValues(res4);
}
void testSampling(){
void testPerforation2(){
printf("***** Testing Perforation ***** \n\n");
Tensor* input = (Tensor*) create4DTensor(CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW, 1, 1, 8, 8);
fillTensorWithVal(input, 3);
//fillWithOnesAndTwos(input);
Tensor* filter = (Tensor*) create4DTensor(CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW, 1, 1, 3, 3);
fillTensorWithVal(filter, 2);
float* host_ptr = (float*) ((struct Tensor*) input)->host_data;
host_ptr[16] = 0;
host_ptr[17] = 0;
host_ptr[18] = 0;
host_ptr[19] = 0;
host_ptr[20] = 0;
host_ptr[21] = 0;
host_ptr[22] = 0;
host_ptr[23] = 0;
host_ptr[56] = 0;
host_ptr[57] = 0;
host_ptr[58] = 0;
host_ptr[59] = 0;
host_ptr[60] = 0;
host_ptr[61] = 0;
host_ptr[62] = 0;
host_ptr[63] = 0;
void* res2 = tensorConvApproxHalf2(input, filter, 0, 0, 1, 1, 1, 1, 4, 1, 1, 1);
convertToFP32((struct Tensor*) res2);
printTensorValues(res2);
}
void testSampling(){
printf("***** Testing Sampling ***** \n\n");
Tensor* input = (Tensor*) create4DTensor(CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW, 1, 3, 4, 4);
fillTensorWithVal(input, 1);
//fillWithOnesAndTwos(input);
......@@ -599,6 +644,28 @@ void testSampling(){
void testSampling2(){
printf("***** TestingSampling2 ***** \n\n");
Tensor* input = (Tensor*) create4DTensor(CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW, 1, 3, 2, 2);
fillTensorWithVal(input, 2);
//fillWithOnesAndTwos(input);
Tensor* filter = (Tensor*) create4DTensor(CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW, 4, 3, 1, 1);
fillTensorWithVal(filter, 2);
// Interpolation not being applied most likely
void* res = tensorConvApprox(input, filter, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
printTensorValues(res);
}
......@@ -631,11 +698,17 @@ int main(){
//testSampleFilter();
//--- testPerforation();
//testPerforation();
// testPerforation2();
testSampling();
//-- testSampling();
testSampling2();
stopProfiling();
......
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