- removed comment
thorn vectors fails if vectorization is disabled
Issue #2078
closed
At least in one case (gcc 7.2) thorn Vectors seems to fail with a message that overloading is not allowed in line 671 of vectors.h
explicit constexpr vectype(scalar_t const &a) : v(props::set1(a)) {}
if vectorization is disabled (VECTORISE=no). My guess would be that in this case scalar_t and vector_t are the same and a conflict exists (or some other assumption is violated).
I'll provide more details once I have a a nicer testcase.
Keyword: Vectors
Comments (8)
-
-
reporter - changed title to thorn vectors fails if vectorization is disabled
- removed comment
-
reporter - removed comment
Ok, got a test case:
diff --git a/Vectors/src/vectors.cc b/Vectors/src/vectors.cc index a2725d3..ffbf9b2 100644 --- a/Vectors/src/vectors.cc +++ b/Vectors/src/vectors.cc @@ -7,5 +7,8 @@ extern "C" int Vectors_Startup(void) { CCTK_VInfo(CCTK_THORNSTRING, "Using vector size %d for architecture %s", CCTK_REAL_VEC_SIZE, vec_architecture); + + CCTK_REAL myscal = 42.; + vectype<CCTK_REAL> myvec(myscal); return 0; }
which fails with:
n file included from /data/rhaas/postdoc/gr/cactus/ET_trunk/configs/sim/build/Vectors/vectors.cc:1:0: /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CactusUtils/Vectors/src/vectors.h: In instantiation of ‘class vectype<double>’: /data/rhaas/postdoc/gr/cactus/ET_trunk/configs/sim/build/Vectors/vectors.cc:12:34: required from here /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CactusUtils/Vectors/src/vectors.h:671:22: error: ‘constexpr vectype<T>::vectype(const scalar_t&) [with T = double; vectype<T>::scalar_t = double]’ cannot be overloaded explicit constexpr vectype(scalar_t const &a) : v(props::set1(a)) {} ^~~~~~~ /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CactusUtils/Vectors/src/vectors.h:670:13: error: with ‘constexpr vectype<T>::vectype(const vector_t&) [with T = double; vectype<T>::vector_t = double]’ constexpr vectype(vector_t const &x) : v(x) {} ^~~~~~~
I attach a tarball of the modified Vectors thorn as well as config-info.
-
reporter - changed status to open
- assigned issue to
- removed comment
-
reporter - changed milestone to ET_2018_02
- removed comment
@eschnett: ping
-
reporter - changed status to resolved
- removed comment
-
reporter - removed comment
-
reporter - edited description
- changed status to closed
- Log in to comment
I cannot repeat this on MacOS with gcc 7.2.0.
Without vectorization, the types "scalar_t" and "vector_t" are indeed the same. However, "vectype" is a different type -- it is a C++ class wrapping "vector_t", and providing a more modern interface.
Can you post the full error message?