RadialIntegration: Use pointer to transfer integration to the sub-thread
This commit is contained in:
@@ -9,12 +9,12 @@
|
||||
|
||||
Logger logger{"RadialIntegrationCPUTest"};
|
||||
|
||||
void RunRadialIntegrationThread(RadialIntegration &integration,
|
||||
void RunRadialIntegrationThread(RadialIntegration *integration,
|
||||
int16_t* image, size_t nimages,
|
||||
size_t image0, size_t stride,
|
||||
size_t npixel) {
|
||||
for (size_t i = image0; i < nimages; i += stride)
|
||||
integration.ProcessOneImage(image + i * npixel, npixel);
|
||||
integration->ProcessOneImage(image + i * npixel, npixel);
|
||||
}
|
||||
|
||||
auto TestRadialIntegration(const DiffractionExperiment &experiment,
|
||||
@@ -38,7 +38,7 @@ auto TestRadialIntegration(const DiffractionExperiment &experiment,
|
||||
std::vector<std::future<void>> futures;
|
||||
for (int i = 0; i < nthreads; i++) {
|
||||
futures.emplace_back(std::async(std::launch::async, &RunRadialIntegrationThread,
|
||||
std::ref(integration[i]), image, nimages, i, nthreads,
|
||||
&integration[i], image, nimages, i, nthreads,
|
||||
experiment.GetPixelsNum()));
|
||||
}
|
||||
for (auto &f: futures)
|
||||
|
||||
Reference in New Issue
Block a user