Skip to content

Commit

Permalink
ConvertColorToGrayScaleTest: Allow compilation without TBB
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Nov 29, 2022
1 parent 0afaa68 commit f45085c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Source/RESTClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ set(RESTClient_HDRS
${RESTClient_SOURCE_DIR}/mrestrequestmanager.h
${RESTClient_SOURCE_DIR}/mrestrequestptr.h
${RESTClient_SOURCE_DIR}/mrestrequestqueue.h
${RESTClient_SOURCE_DIR}/RESTClientDLLExport
${RESTClient_SOURCE_DIR}/RESTClientDLLExport.h
${RESTClient_SOURCE_DIR}/SIMPLClientRequest.h
${RESTClient_SOURCE_DIR}/SIMPLRestClient.h
${RESTClient_SOURCE_DIR}/userptr.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
#include "SIMPLib/Testing/SIMPLTestFileLocations.h"
#include "SIMPLib/Testing/UnitTestSupport.hpp"

#include <tbb/parallel_for.h>


class ConvertColorToGrayScaleTest
{
Expand Down Expand Up @@ -350,12 +348,11 @@ class ConvertColorToGrayScaleTest
std::vector<uint8_t> colorArray{algorithmMap[algoMapIndex]};

int wrongValues = 0;
tbb::parallel_for(tbb::blocked_range<size_t>(0, colorArray.size()), [&](const tbb::blocked_range<size_t>& r) {
for(size_t index = r.begin(); index < r.end(); ++index)
{
wrongValues += (testArray->getValue(index) == colorArray[index]) ? 0 : 1;
}
});
for(size_t index = 0; index < colorArray.size(); ++index)
{
wrongValues += (testArray->getValue(index) == colorArray[index]) ? 0 : 1;
}

return wrongValues;
}

Expand Down

0 comments on commit f45085c

Please sign in to comment.