Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BLAS-join
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Google-TPU
BLAS-join
Commits
db561393
Commit
db561393
authored
Apr 17, 2018
by
Martin Perdacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix dataIo
parent
049ac6fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
cmake/util/arguments.cpp
cmake/util/arguments.cpp
+14
-14
cmake/util/dataIo.cpp
cmake/util/dataIo.cpp
+3
-2
No files found.
cmake/util/arguments.cpp
View file @
db561393
...
...
@@ -7,18 +7,18 @@ void parsing_args(int argc, char* argv[], size_t *n, double *epsilon, size_t *d,
char
c
;
FILE
*
file
;
//
if ( argc < 6 ){
//
fprintf (stderr, "There are obligatory parameters.\n");
//
fprintf (stderr, "Usage: ./blasJoin ");
//
//
fprintf(stderr, "Obligatory parameters: \n");
//
fprintf(stderr, "n (number of objects in thousands (*1000))\ne (epsilon)\nd (dimensionality)\ns (blocksize)");
//
fprintf(stderr, "Optional parameters: \n t number of threads\n\n");
//
fprintf(stderr, "f (filename) if there is no filename we use random generated data [0.0, 100.0)\n");
//
fprintf(stderr, "b use the -b argument without options to specify that it is a binary file.\n");
//
fprintf(stderr, "Example (with default values): ./blasJoin -n 200 -e 0.2 -d 20 -s 5000 -t 64\n");
//
exit(1);
//
}
if
(
argc
<
6
){
fprintf
(
stderr
,
"There are obligatory parameters.
\n
"
);
fprintf
(
stderr
,
"Usage: ./blasJoin "
);
fprintf
(
stderr
,
"Obligatory parameters:
\n
"
);
fprintf
(
stderr
,
"n (number of objects in thousands (*1000))
\n
e (epsilon)
\n
d (dimensionality)
\n
s (blocksize)"
);
fprintf
(
stderr
,
"Optional parameters:
\n
t number of threads
\n\n
"
);
fprintf
(
stderr
,
"f (filename) if there is no filename we use random generated data [0.0, 100.0)
\n
"
);
fprintf
(
stderr
,
"b use the -b argument without options to specify that it is a binary file.
\n
"
);
fprintf
(
stderr
,
"Example (with default values): ./blasJoin -n 200 -e 0.2 -d 20 -s 5000 -t 64
\n
"
);
exit
(
1
);
}
while
(
(
c
=
getopt
(
argc
,
argv
,
"n:e:d:t:s:f:b"
)
)
!=
-
1
)
{
...
...
@@ -72,9 +72,9 @@ void parsing_args(int argc, char* argv[], size_t *n, double *epsilon, size_t *d,
}
}
if
(
*
blocksize
>
*
n
*
1000
||
*
blocksize
<=
1
){
if
(
*
blocksize
>
*
n
||
*
blocksize
<=
1
){
fprintf
(
stderr
,
"Blocksize has to be greater than 1 and smaller or equal to N
\n
"
);
printf
(
"n:%d, blocksize: %d
\n
"
,
*
n
*
1000
,
*
blocksize
);
printf
(
"n:%d, blocksize: %d
\n
"
,
*
n
,
*
blocksize
);
exit
(
1
);
}
...
...
cmake/util/dataIo.cpp
View file @
db561393
...
...
@@ -25,7 +25,7 @@ void read_file(double *array, const int N, const int D, char filename[], const b
size_t
i
=
0
,
j
=
0
;
char
line
[
MAX_LINE_LENGTH
];
char
*
token
=
NULL
;
const
char
space
[
2
]
=
"
"
;
const
char
space
[
2
]
=
"
,
"
;
fp
=
fopen
(
filename
,
"r"
);
...
...
@@ -35,9 +35,10 @@ void read_file(double *array, const int N, const int D, char filename[], const b
}
if
(
IS_BINARY
){
// printf("isbinary!\n");
// read binary file, everything at once
counts
=
fread
(
array
,
N
*
D
,
sizeof
(
double
),
fp
);
// printf("%dx%d: %d readed\n", N, D, counts);
if
(
counts
==
0
)
{
fprintf
(
stderr
,
"Binary file '%s' could not be read. Wrong format."
,
filename
);
exit
(
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment