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
Jira
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
Oliver Behnke
libclfft
Commits
1c88b7b0
Commit
1c88b7b0
authored
14 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
Add simple debug option (for all platforms)
parent
4022245c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
example/main.cpp
+26
-18
26 additions, 18 deletions
example/main.cpp
with
26 additions
and
18 deletions
example/main.cpp
+
26
−
18
View file @
1c88b7b0
...
@@ -376,7 +376,7 @@ void convertInterleavedToSplit(clFFT_SplitComplex *result_split, clFFT_Complex *
...
@@ -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
,
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
;
cl_int
err
=
CL_SUCCESS
;
int
iter
;
int
iter
;
...
@@ -614,7 +614,9 @@ int runTest(clFFT_Dim3 n, int batchSize, clFFT_Direction dir, clFFT_Dimension di
...
@@ -614,7 +614,9 @@ int runTest(clFFT_Dim3 n, int batchSize, clFFT_Direction dir, clFFT_Dimension di
free
(
result_split
.
real
);
free
(
result_split
.
real
);
free
(
result_split
.
imag
);
free
(
result_split
.
imag
);
}
}
#else
#endif
if
(
debugEnabled
)
{
log_info
(
"Output power spectrum for manual validation (normalized):
\n
"
);
log_info
(
"Output power spectrum for manual validation (normalized):
\n
"
);
if
(
dataFormat
!=
clFFT_SplitComplexFormat
)
{
if
(
dataFormat
!=
clFFT_SplitComplexFormat
)
{
clFFT_SplitComplex
result_split
;
clFFT_SplitComplex
result_split
;
...
@@ -632,7 +634,7 @@ int runTest(clFFT_Dim3 n, int batchSize, clFFT_Direction dir, clFFT_Dimension di
...
@@ -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
]));
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
:
cleanup
:
clFFT_DestroyPlan
(
plan
);
clFFT_DestroyPlan
(
plan
);
...
@@ -740,6 +742,8 @@ int main (int argc, char * const argv[]) {
...
@@ -740,6 +742,8 @@ int main (int argc, char * const argv[]) {
clFFT_TestType
testType
=
clFFT_OUT_OF_PLACE
;
clFFT_TestType
testType
=
clFFT_OUT_OF_PLACE
;
cl_device_id
device_ids
[
MAX_DEVICES
];
cl_device_id
device_ids
[
MAX_DEVICES
];
int
debugEnabled
=
0
;
FILE
*
paramFile
;
FILE
*
paramFile
;
cl_int
err
,
status
;
cl_int
err
,
status
;
...
@@ -928,6 +932,10 @@ int main (int argc, char * const argv[]) {
...
@@ -928,6 +932,10 @@ int main (int argc, char * const argv[]) {
return
-
1
;
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
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"
);
paramFile
=
fopen
(
argv
[
1
],
"r"
);
if
(
!
paramFile
)
{
if
(
!
paramFile
)
{
...
@@ -992,7 +1000,7 @@ int main (int argc, char * const argv[]) {
...
@@ -992,7 +1000,7 @@ int main (int argc, char * const argv[]) {
continue
;
continue
;
}
}
err
=
runTest
(
n
,
batchSize
,
dir
,
dim
,
dataFormat
,
numIter
,
testType
);
err
=
runTest
(
n
,
batchSize
,
dir
,
dim
,
dataFormat
,
numIter
,
testType
,
debugEnabled
);
if
(
err
)
if
(
err
)
total_errors
++
;
total_errors
++
;
}
}
...
...
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