diff --git a/ECR/ECR/batchedECR.cu b/ECR/ECR/batchedECR.cu index b8d0ec0..7a86f4e 100644 --- a/ECR/ECR/batchedECR.cu +++ b/ECR/ECR/batchedECR.cu @@ -234,7 +234,8 @@ int main(int argc, char *argv[]) } open_kernel.close(); - ofstream time_file(string("ECR/ECR/time_vgg/batchsize") + argv[1] + string(".txt")); + ofstream time_file("ECR/ECR/time_vgg/batchsize" + + std::to_string(atoi(argv[1])) + string(".txt")); // resnet is 32, vgg is 16, sp is 9, resnet is 49 for (int i = 1; i < 16; i++) { diff --git a/ECR/ECR/time_vgg/batchedECR.cu b/ECR/ECR/time_vgg/batchedECR.cu index 30d7929..dc09c0d 100644 --- a/ECR/ECR/time_vgg/batchedECR.cu +++ b/ECR/ECR/time_vgg/batchedECR.cu @@ -234,7 +234,8 @@ int main(int argc, char *argv[]) } open_kernel.close(); - ofstream time_file("ECR/ECR/time_vgg/batchsize" + argv[1] + string(".txt")); + ofstream time_file("ECR/ECR/time_vgg/batchsize" + + std::to_string(atoi(argv[1])) + string(".txt")); // resnet is 32, vgg is 16, sp is 9, resnet is 49 for (int i = 0; i < 16; i++) { diff --git a/PECR/cudnn/time_vgg/cudnn_half.cu b/PECR/cudnn/time_vgg/cudnn_half.cu index 224adc1..b92634f 100644 --- a/PECR/cudnn/time_vgg/cudnn_half.cu +++ b/PECR/cudnn/time_vgg/cudnn_half.cu @@ -53,8 +53,11 @@ half *LoadvggKernel(string name, int *&kernel_width, int *&kernel_height, int ba return kernel; } -half *LoadKernel(string name, int *&kernel_width, int *&kernel_height, int batch_size, int index) -{ +// half return type should be replaced with float + +float *LoadKernel(string name, int *&kernel_width, int *&kernel_height, + int batch_size, int index) { + float temp; // ifstream kernel_shape("/home/syt/conv_pool/conv_pool/dataset/kernel/kernel_shape/" + name); // for (int i = 0; i < 2; i++) // { @@ -70,9 +73,11 @@ half *LoadKernel(string name, int *&kernel_width, int *&kernel_height, int batch for (int i = 0; i < batch_size; i++) { ifstream kernel_data("/home/syt/conv_pool/conv_pool/dataset/resnetdataset_all/kernel/" + name); - for (int j = i * (*kernel_width * *kernel_height); j < (i + 1) * (*kernel_width * *kernel_height); j++) + for (int j = i * (*kernel_width * *kernel_height); + j < (i + 1) * (*kernel_width * *kernel_height); j++) { kernel_data >> temp; kernel[j]=__float2half(temp); + } kernel_data.close(); } @@ -138,8 +143,10 @@ float *LoadConvWeight(int *&fea_width, int *&fea_height, int batch_size, int ind for (int i = 0; i < batch_size; i++) { ifstream fea_data("/home/syt/conv_pool/conv_pool/dataset/resnetdataset_all/feature/" + name[index]); - for (int j = i * (*fea_width * *fea_height); j < (i + 1) * (*fea_width * *fea_height); j++) + for (int j = i * (*fea_width * *fea_height); + j < (i + 1) * (*fea_width * *fea_height); j++) { fea_data >> feature[j]; + } fea_data.close(); }