Skip to content
Snippets Groups Projects
Commit 5ac780b1 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: std::execution not supported by clang?

parent 4260ce68
No related branches found
No related tags found
1 merge request!42RF: Improve thread-safety of `NEWIMAGE::volume` class
Pipeline #26998 passed
......@@ -4,6 +4,8 @@ include ${FSLCONFDIR}/default.mk
PROJNAME = test-newimage
TESTXFILES = test-newimage
all: ${TESTXFILES}
LIBS = -lfsl-newimage -lfsl-miscmaths -lfsl-NewNifti \
-lfsl-cprob -lfsl-utils -lfsl-znz -lboost_unit_test_framework -lpthread
......@@ -28,16 +30,16 @@ ifeq ($(SYSTYPE), Darwin)
RPATH := -Wl,-rpath,'@executable_path/..'
endif
all: ${TESTXFILES}
USRCXXFLAGS = -I..
# Need this flag to enable std::execution
# policies in clang
ifeq ($(SYSTYPE), Darwin)
USRCXXFLAGS += -fexperimental-library
endif
OBJS := $(wildcard test_*.cc)
OBJS := $(OBJS:%.cc=%.o)
# We add -I.., -L.., -Wl,-rpath so that
# in-source builds take precedence over
# $FSLDEVDIR/$FSLDIR
%.o: %.cc
$(CXX) -I.. ${CXXFLAGS} -c -o $@ $<
test-newimage: ${OBJS}
$(CXX) -o $@ $^ -L.. ${RPATH} ${LDFLAGS}
$(CXX) ${CXXFLAGS} -o $@ $^ -L.. ${RPATH} ${LDFLAGS}
......@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(std_for_each)
result.push_back(vol(x, y, z) * 10);
};
std::for_each(std::execution::seq, vol.vbegin(), vol.vend(), run_task_on_voxel);
std::for_each(vol.vbegin(), vol.vend(), run_task_on_voxel);
int i = 0;
for (int z = 0; z < 5; z++) {
......@@ -89,8 +89,7 @@ BOOST_AUTO_TEST_CASE(std_transform)
};
std::vector<float> result(vol.nvoxels());
std::transform(std::execution::seq,
vol.vbegin(),
std::transform(vol.vbegin(),
vol.vend(),
result.begin(),
run_task_on_voxel);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment