Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
6e835b56
Commit
6e835b56
authored
3 years ago
by
leonkm2
Committed by
Yifan Zhao
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make hpvm-cava allocate file paths dynamically
parent
c773999d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hpvm/test/benchmarks/hpvm-cava/src/main.c
+13
-6
13 additions, 6 deletions
hpvm/test/benchmarks/hpvm-cava/src/main.c
with
13 additions
and
6 deletions
hpvm/test/benchmarks/hpvm-cava/src/main.c
+
13
−
6
View file @
6e835b56
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
#include
"hpvm.h"
#include
"hpvm.h"
// Max file extension size
#define MAX_EXT_SIZE 20
int
NUM_TEST_CASES
;
int
NUM_TEST_CASES
;
int
NUM_CLASSES
;
int
NUM_CLASSES
;
int
INPUT_DIM
;
int
INPUT_DIM
;
...
@@ -875,29 +878,33 @@ int main(int argc, char *argv[]) {
...
@@ -875,29 +878,33 @@ int main(int argc, char *argv[]) {
// Output the image.
// Output the image.
// NOTE: We deliberately perform this file I/O outside of the kernel.
// NOTE: We deliberately perform this file I/O outside of the kernel.
char
str
[
50
],
base_str
[
50
];
const
int
len
=
strlen
(
args
.
args
[
OUTPUT_IMAGE_BIN
]);
const
char
*
base_str
=
args
.
args
[
OUTPUT_IMAGE_BIN
];
char
*
str
=
malloc
(
sizeof
(
char
)
*
len
+
MAX_EXT_SIZE
+
1
);
// Handles the extensions below
strcpy
(
base_str
,
args
.
args
[
OUTPUT_IMAGE_BIN
]);
strcpy
(
base_str
,
args
.
args
[
OUTPUT_IMAGE_BIN
]);
strcpy
(
str
,
base_str
);
strcpy
(
str
,
base_str
);
strcat
(
str
,
".bin"
);
str
n
cat
(
str
,
".bin"
,
MAX_EXT_SIZE
);
printf
(
"Writing output image to %s
\n
"
,
str
);
printf
(
"Writing output image to %s
\n
"
,
str
);
write_image_to_binary
(
str
,
image_out
,
row_size
,
col_size
);
write_image_to_binary
(
str
,
image_out
,
row_size
,
col_size
);
strcpy
(
str
,
base_str
);
strcpy
(
str
,
base_str
);
strcat
(
str
,
"_gamut.bin"
);
str
n
cat
(
str
,
"_gamut.bin"
,
MAX_EXT_SIZE
);
printf
(
"Writing output image to %s
\n
"
,
str
);
printf
(
"Writing output image to %s
\n
"
,
str
);
write_image_to_binary
(
str
,
image_out_gamut
,
row_size
,
col_size
);
write_image_to_binary
(
str
,
image_out_gamut
,
row_size
,
col_size
);
strcpy
(
str
,
base_str
);
strcpy
(
str
,
base_str
);
strcat
(
str
,
"_demosaic.bin"
);
str
n
cat
(
str
,
"_demosaic.bin"
,
MAX_EXT_SIZE
);
printf
(
"Writing output image to %s
\n
"
,
str
);
printf
(
"Writing output image to %s
\n
"
,
str
);
write_image_to_binary
(
str
,
image_out_demosaic
,
row_size
,
col_size
);
write_image_to_binary
(
str
,
image_out_demosaic
,
row_size
,
col_size
);
strcpy
(
str
,
base_str
);
strcpy
(
str
,
base_str
);
strcat
(
str
,
"_denoise.bin"
);
str
n
cat
(
str
,
"_denoise.bin"
,
MAX_EXT_SIZE
);
printf
(
"Writing output image to %s
\n
"
,
str
);
printf
(
"Writing output image to %s
\n
"
,
str
);
write_image_to_binary
(
str
,
image_out_denoise
,
row_size
,
col_size
);
write_image_to_binary
(
str
,
image_out_denoise
,
row_size
,
col_size
);
strcpy
(
str
,
base_str
);
strcpy
(
str
,
base_str
);
strcat
(
str
,
"_transform.bin"
);
str
n
cat
(
str
,
"_transform.bin"
,
MAX_EXT_SIZE
);
printf
(
"Writing output image to %s
\n
"
,
str
);
printf
(
"Writing output image to %s
\n
"
,
str
);
write_image_to_binary
(
str
,
image_out_transform
,
row_size
,
col_size
);
write_image_to_binary
(
str
,
image_out_transform
,
row_size
,
col_size
);
free
(
str
);
__hpvm__cleanup
();
__hpvm__cleanup
();
return
0
;
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment