Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libclfft
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
einsteinathome
libclfft
Commits
8700469d
Commit
8700469d
authored
14 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
Added feature to use an input data file instead of random values
parent
8409f6fd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
example/main.cpp
+27
-4
27 additions, 4 deletions
example/main.cpp
example/test.single
+1
-1
1 addition, 1 deletion
example/test.single
with
28 additions
and
5 deletions
example/main.cpp
+
27
−
4
View file @
8700469d
...
...
@@ -374,7 +374,7 @@ void convertInterleavedToSplit(clFFT_SplitComplex *result_split, clFFT_Complex *
}
}
int
runTest
(
clFFT_Dim3
n
,
int
batchSize
,
clFFT_Direction
dir
,
clFFT_Dimension
dim
,
int
runTest
(
FILE
*
input
,
clFFT_Dim3
n
,
int
batchSize
,
clFFT_Direction
dir
,
clFFT_Dimension
dim
,
clFFT_DataFormat
dataFormat
,
int
numIter
,
clFFT_TestType
testType
,
int
debugEnabled
)
{
cl_int
err
=
CL_SUCCESS
;
...
...
@@ -457,6 +457,18 @@ int runTest(clFFT_Dim3 n, int batchSize, clFFT_Direction dir, clFFT_Dimension di
data_oref
.
imag
[
i
]
=
data_iref
.
imag
[
i
];
}
}
else
if
(
NULL
!=
input
)
{
for
(
i
=
0
;
i
<
length
;
i
++
)
{
fscanf
(
input
,
"%f
\n
"
,
&
data_i
[
i
].
real
);
data_i
[
i
].
imag
=
0.0
f
;
data_cl
[
i
].
real
=
0.0
f
;
data_cl
[
i
].
imag
=
0.0
f
;
data_iref
.
real
[
i
]
=
data_i
[
i
].
real
;
data_iref
.
imag
[
i
]
=
data_i
[
i
].
imag
;
data_oref
.
real
[
i
]
=
data_iref
.
real
[
i
];
data_oref
.
imag
[
i
]
=
data_iref
.
imag
[
i
];
}
}
else
{
for
(
i
=
0
;
i
<
length
;
i
++
)
{
...
...
@@ -731,6 +743,7 @@ int main (int argc, char * const argv[]) {
test_start
();
FILE
*
inputData
=
NULL
;
cl_ulong
gMemSize
;
clFFT_Direction
dir
=
clFFT_Forward
;
int
numIter
=
1
;
...
...
@@ -922,7 +935,7 @@ int main (int argc, char * const argv[]) {
char
delim
[]
=
"
\n
"
;
char
tmpStr
[
100
];
char
line
[
2
00
];
char
line
[
5
00
];
char
*
param
,
*
val
;
int
total_errors
=
0
;
if
(
argc
==
1
)
{
...
...
@@ -944,7 +957,7 @@ int main (int argc, char * const argv[]) {
test_finish
();
return
-
3
;
}
while
(
fgets
(
line
,
1
99
,
paramFile
))
{
while
(
fgets
(
line
,
4
99
,
paramFile
))
{
if
(
!
strcmp
(
line
,
""
)
||
!
strcmp
(
line
,
"
\n
"
)
||
ifLineCommented
(
line
))
continue
;
param
=
strtok
(
line
,
delim
);
...
...
@@ -991,6 +1004,16 @@ int main (int argc, char * const argv[]) {
else
if
(
!
strcmp
(
tmpStr
,
"in-place"
))
testType
=
clFFT_IN_PLACE
;
}
else
if
(
!
strcmp
(
param
,
"-inputdatafile"
))
{
sscanf
(
val
,
"%s"
,
tmpStr
);
inputData
=
fopen
(
tmpStr
,
"r"
);
if
(
!
inputData
)
{
printf
(
"ERROR: Couldn't open input data file (%s)! Using random data instead...
\n
"
,
val
);
}
else
{
printf
(
"INFO: Using input data file
\"
%s
\"
...
\n
"
,
val
);
}
}
param
=
strtok
(
NULL
,
delim
);
}
...
...
@@ -999,7 +1022,7 @@ int main (int argc, char * const argv[]) {
continue
;
}
err
=
runTest
(
n
,
batchSize
,
dir
,
dim
,
dataFormat
,
numIter
,
testType
,
debugEnabled
);
err
=
runTest
(
inputData
,
n
,
batchSize
,
dir
,
dim
,
dataFormat
,
numIter
,
testType
,
debugEnabled
);
if
(
err
)
total_errors
++
;
}
...
...
This diff is collapsed.
Click to expand it.
example/test.single
+
1
−
1
View file @
8700469d
-n 256 1 1 -batchsize 1 -dir forward -dim 1D -format interleaved -numiter 1 -testtype in-place
-n 256 1 1 -batchsize 1 -dir forward -dim 1D -format interleaved -numiter 1 -testtype in-place
-inputdatafile test_waveform.dat
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