thorn vectors fails if vectorization is disabled

Create issue
Issue #2078 closed
Roland Haas created an issue

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)

  1. Erik Schnetter
    • removed 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?

  2. Roland Haas reporter
    • removed comment

    Ok, got a test case:

    diff --git a/Vectors/src/ b/Vectors/src/
    index a2725d3..ffbf9b2 100644
    --- a/Vectors/src/
    +++ b/Vectors/src/
    @@ -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/
    /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/   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.

  3. Roland Haas reporter
    • removed comment

    Applied in git hash db84c98c "CarpetLib: use O1 in for all Intel >17.0 compilers" of Carpet for carpet master and git hash 703ac0d3 "CarpetLib: use O1 in for all Intel >17.0 compilers" in ET_2017_06.

  4. Log in to comment