Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oliver Behnke
libclfft
Commits
1c88b7b0
Commit
1c88b7b0
authored
Mar 21, 2011
by
Oliver Bock
Browse files
Add simple debug option (for all platforms)
parent
4022245c
Changes
1
Show whitespace changes
Inline
Side-by-side
example/main.cpp
View file @
1c88b7b0
...
...
@@ -376,7 +376,7 @@ void convertInterleavedToSplit(clFFT_SplitComplex *result_split, clFFT_Complex *
}
int
runTest
(
clFFT_Dim3
n
,
int
batchSize
,
clFFT_Direction
dir
,
clFFT_Dimension
dim
,
clFFT_DataFormat
dataFormat
,
int
numIter
,
clFFT_TestType
testType
)
clFFT_DataFormat
dataFormat
,
int
numIter
,
clFFT_TestType
testType
,
int
debugEnabled
)
{
cl_int
err
=
CL_SUCCESS
;
int
iter
;
...
...
@@ -614,7 +614,9 @@ int runTest(clFFT_Dim3 n, int batchSize, clFFT_Direction dir, clFFT_Dimension di
free
(
result_split
.
real
);
free
(
result_split
.
imag
);
}
#else
#endif
if
(
debugEnabled
)
{
log_info
(
"Output power spectrum for manual validation (normalized):
\n
"
);
if
(
dataFormat
!=
clFFT_SplitComplexFormat
)
{
clFFT_SplitComplex
result_split
;
...
...
@@ -632,7 +634,7 @@ int runTest(clFFT_Dim3 n, int batchSize, clFFT_Direction dir, clFFT_Dimension di
printf
(
"%f
\n
"
,
normFactor
*
(
data_cl_split
.
real
[
i
]
*
data_cl_split
.
real
[
i
]
+
data_cl_split
.
imag
[
i
]
*
data_cl_split
.
imag
[
i
]));
}
}
#endif
}
cleanup:
clFFT_DestroyPlan
(
plan
);
...
...
@@ -740,6 +742,8 @@ int main (int argc, char * const argv[]) {
clFFT_TestType
testType
=
clFFT_OUT_OF_PLACE
;
cl_device_id
device_ids
[
MAX_DEVICES
];
int
debugEnabled
=
0
;
FILE
*
paramFile
;
cl_int
err
,
status
;
...
...
@@ -928,6 +932,10 @@ int main (int argc, char * const argv[]) {
return
-
1
;
}
if
(
4
==
argc
&&
1
==
!
strcmp
(
argv
[
3
],
"debug"
))
{
debugEnabled
=
1
;
}
if
(
argc
>=
2
)
{
// arguments are supplied in a file with arguments for a single run are all on the same line
paramFile
=
fopen
(
argv
[
1
],
"r"
);
if
(
!
paramFile
)
{
...
...
@@ -992,7 +1000,7 @@ int main (int argc, char * const argv[]) {
continue
;
}
err
=
runTest
(
n
,
batchSize
,
dir
,
dim
,
dataFormat
,
numIter
,
testType
);
err
=
runTest
(
n
,
batchSize
,
dir
,
dim
,
dataFormat
,
numIter
,
testType
,
debugEnabled
);
if
(
err
)
total_errors
++
;
}
...
...
Write
Preview
Supports
Markdown
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