Skip to content

Commit

Permalink
Merge pull request praat#2782 from davidweenink/master
Browse files Browse the repository at this point in the history
restore multi-threading parameters after testing
  • Loading branch information
davidweenink authored Nov 8, 2024
2 parents 1656742 + 3d2e872 commit 5b9ff64
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dwtools/SampledToSampledWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ void SampledToSampledWorkspace_analyseThreaded (mutableSampledToSampledWorkspace
}

void timeMultiThreading (double soundDuration) {
/*
Save current multi-threading situation
*/
struct ThreadingPreferences savedPreferences = preferences;
try {
Melder_require (preferences.numberOfConcurrentThreadsAvailable > 1,
U"No multi-threading possible.");
/*
Save current situation
*/
struct ThreadingPreferences savedPreferences = preferences;
autoVEC framesPerThread {50, 100, 200, 400, 800, 1600, 3200};
const integer maximumNumberOfThreads = std::thread::hardware_concurrency ();
autoSound me = Sound_createSimple (1_integer, soundDuration, 5500.0);
Expand Down Expand Up @@ -292,8 +292,11 @@ void timeMultiThreading (double soundDuration) {
}
}
MelderInfo_close ();
preferences = savedPreferences;
} catch (MelderError) {
preferences = savedPreferences;
Melder_throw (U"Could not perform timing.");
}
}

/* End of file SampledToSampledWorkspace.cpp */

0 comments on commit 5b9ff64

Please sign in to comment.