Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Fixes to Allow Compilation #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ECR/ECR/batchedECR.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down
3 changes: 2 additions & 1 deletion ECR/ECR/time_vgg/batchedECR.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down
15 changes: 11 additions & 4 deletions PECR/cudnn/time_vgg/cudnn_half.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
// {
Expand All @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down