Skip to content
Snippets Groups Projects
Commit 1c88b7b0 authored by Oliver Bock's avatar Oliver Bock
Browse files

Add simple debug option (for all platforms)

parent 4022245c
No related branches found
No related tags found
No related merge requests found
...@@ -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++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment