Building DenseVector operation tests in Blazetest fails

Issue #206 resolved
Shahrzad Shirzad created an issue

Hi Klaus,

I'm getting this error when I make essential in blazetest:

Building the DenseVector operation tests...
clang++ -O3 -std=c++17 -stdlib=libc++ -DNDEBUG -fopenmp -fpermissive -isystem /home/shahrzad/src/blaze/blazetest -isystem /home/shahrzad/src/blaze   -c -o OperationTest.o OperationTest.cpp
In file included from OperationTest.cpp:43:
In file included from /home/shahrzad/src/blaze/blaze/math/DynamicVector.h:45:
In file included from /home/shahrzad/src/blaze/blaze/math/DenseVector.h:54:
In file included from /home/shahrzad/src/blaze/blaze/math/expressions/DVecMapExpr.h:54:
In file included from /home/shahrzad/src/blaze/blaze/math/Functors.h:43:

/home/shahrzad/src/blaze/blaze/math/functors/Abs.h:96:14: error: call to deleted function 'abs'
      return abs( a );

Could you please help me with that?

Thanks, Shahrzad

Comments (12)

  1. Klaus Iglberger

    Hi Shahrzad!

    Thanks for creating this issue. Despite using exactly the same compiler flags as you, unfortunately I'm not able to reproduce the issue on my systems. Also, I unfortunately don't see which abs() function should be deleted and could cause the problem. Are you able to provide more details, for instance the remainder of the compiler error message? It would help to learn which abs() function causes the problem. Thanks,

    Best regards,

    Klaus!

  2. Shahrzad Shirzad reporter

    Sure, this is the remaining part.

    Building the DenseVector operation tests...
    clang++ -O3 -std=c++17 -stdlib=libc++ -DNDEBUG -fopenmp -fpermissive -isystem /home/shahrzad/lib/blaze/include/ -isystem /home/shahrzad/src/blaze/blazetest -isystem /home/shahrzad/src/blaze   -c -o OperationTest.o OperationTest.cpp
    In file included from OperationTest.cpp:43:
    In file included from /home/shahrzad/lib/blaze/include/blaze/math/DynamicVector.h:45:
    In file included from /home/shahrzad/lib/blaze/include/blaze/math/DenseVector.h:54:
    In file included from /home/shahrzad/lib/blaze/include/blaze/math/expressions/DVecMapExpr.h:54:
    In file included from /home/shahrzad/lib/blaze/include/blaze/math/Functors.h:43:
    /home/shahrzad/lib/blaze/include/blaze/math/functors/Abs.h:96:14: error: call to deleted function 'abs'
          return abs( a );
                 ^~~
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/DVecNormExpr.h:238:22: note: in instantiation of function template specialization 'blaze::Abs::operator()<blaze::SIMDint32>' requested here
          xmm1 += power( abs( tmp.load(i             ) ) );
                         ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/DVecNormExpr.h:291:11: note: in instantiation of function template specialization 'blaze::norm_backend<blaze::DynamicVector<int, true>, true, blaze::Abs, blaze::Noop, blaze::Noop>' requested here
       return norm_backend( ~dv, abs, power, root, Bool< DVecNormHelper<VT,Abs,Power>::value >() );
              ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/DVecNormExpr.h:370:11: note: in instantiation of function template specialization 'blaze::norm_backend<blaze::DynamicVector<int, true>, true, blaze::Abs, blaze::Noop, blaze::Noop>' requested here
       return norm_backend( ~dv, Abs(), Noop(), Noop() );
              ^
    OperationTest.cpp:626:31: note: in instantiation of function template specialization 'blaze::l1Norm<blaze::DynamicVector<int, true>, true>' requested here
          const int norm = blaze::l1Norm( vec );
                                  ^
    /home/shahrzad/lib/blaze/include/blaze/math/simd/Abs.h:138:37: note: candidate function has been explicitly deleted
    BLAZE_ALWAYS_INLINE const SIMDint32 abs( const SIMDint32& a ) noexcept
                                        ^
    /usr/include/stdlib.h:837:12: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'int' for 1st argument
    extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
               ^
    /usr/bin/../include/c++/v1/stdlib.h:111:44: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'long' for 1st argument
    inline _LIBCPP_INLINE_VISIBILITY long      abs(     long __x) _NOEXCEPT {return  labs(__x);}
                                               ^
    /usr/bin/../include/c++/v1/stdlib.h:113:44: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'long long' for 1st argument
    inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
                                               ^
    /usr/bin/../include/c++/v1/math.h:733:1: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'float' for 1st argument
    abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
    ^
    /usr/bin/../include/c++/v1/math.h:737:1: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'double' for 1st argument
    abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);}
    ^
    /usr/bin/../include/c++/v1/math.h:741:1: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'long double' for 1st argument
    abs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
    ^
    /home/shahrzad/lib/blaze/include/blaze/math/simd/Abs.h:66:36: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'const blaze::SIMDint8' for 1st argument
    BLAZE_ALWAYS_INLINE const SIMDint8 abs( const SIMDint8& a ) noexcept
                                       ^
    /home/shahrzad/lib/blaze/include/blaze/math/simd/Abs.h:102:37: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'const blaze::SIMDint16' for 1st argument
    BLAZE_ALWAYS_INLINE const SIMDint16 abs( const SIMDint16& a ) noexcept
                                        ^
    /home/shahrzad/lib/blaze/include/blaze/math/simd/Abs.h:174:37: note: candidate function not viable: no known conversion from 'const blaze::SIMDint32' to 'const blaze::SIMDint64' for 1st argument
    BLAZE_ALWAYS_INLINE const SIMDint64 abs( const SIMDint64& a ) noexcept
                                        ^
    /usr/bin/../include/c++/v1/complex:857:1: note: candidate template ignored: could not match 'complex<type-parameter-0-0>' against 'const blaze::SIMDint32'
    abs(const complex<_Tp>& __c)
    ^
    /home/shahrzad/lib/blaze/include/blaze/math/simd/Abs.h:203:37: note: candidate template ignored: could not match 'SIMDf32<type-parameter-0-0>' against 'const blaze::SIMDint32'
    BLAZE_ALWAYS_INLINE const SIMDfloat abs( const SIMDf32<T>& a ) noexcept
                                        ^
    /home/shahrzad/lib/blaze/include/blaze/math/simd/Abs.h:242:38: note: candidate template ignored: could not match 'SIMDf64<type-parameter-0-0>' against 'const blaze::SIMDint32'
    BLAZE_ALWAYS_INLINE const SIMDdouble abs( const SIMDf64<T>& a ) noexcept
                                         ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/DVecMapExpr.h:1164:23: note: candidate template ignored: could not match 'DenseVector<type-parameter-0-0, TF>' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const DenseVector<VT,TF>& dv )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/DVecMapExpr.h:2261:23: note: candidate template ignored: could not match 'DVecMapExpr<type-parameter-0-0, blaze::Abs, TF>' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const DVecMapExpr<VT,Abs,TF>& dv )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/proxy/Proxy.h:981:23: note: candidate template ignored: could not match 'Proxy<type-parameter-0-0, type-parameter-0-1>' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const Proxy<PT,RT>& proxy )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/DMatMapExpr.h:1181:23: note: candidate template ignored: could not match 'DenseMatrix<type-parameter-0-0, >' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const DenseMatrix<MT,SO>& dm )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/DMatMapExpr.h:2278:23: note: candidate template ignored: could not match 'DMatMapExpr<type-parameter-0-0, blaze::Abs, SO>' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const DMatMapExpr<MT,Abs,SO>& dm )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/SVecMapExpr.h:918:23: note: candidate template ignored: could not match 'SparseVector<type-parameter-0-0, TF>' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const SparseVector<VT,TF>& sv )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/SVecMapExpr.h:2015:23: note: candidate template ignored: could not match 'SVecMapExpr<type-parameter-0-0, blaze::Abs, TF>' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const SVecMapExpr<VT,Abs,TF>& sv )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/SMatMapExpr.h:1045:23: note: candidate template ignored: could not match 'SparseMatrix<type-parameter-0-0, >' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const SparseMatrix<MT,SO>& sm )
                          ^
    /home/shahrzad/lib/blaze/include/blaze/math/expressions/SMatMapExpr.h:2143:23: note: candidate template ignored: could not match 'SMatMapExpr<type-parameter-0-0, blaze::Abs, SO>' against 'const blaze::SIMDint32'
    inline decltype(auto) abs( const SMatMapExpr<MT,Abs,SO>& sm )
    
  3. Klaus Iglberger

    Hi Shahrzad!

    Thanks a lot for posting the entire error message. I now understand which abs() function is called. Still, despite my best efforts to reproduce the error I'm not able to do so. In order to better understand the problem, could you please post the output of the following piece of code?

    std::cerr << "\n"
              << " BLAZE_SSE_MODE      = " << BLAZE_SSE_MODE << "\n"
              << " BLAZE_SSE2_MODE     = " << BLAZE_SSE2_MODE << "\n"
              << " BLAZE_SSE3_MODE     = " << BLAZE_SSE3_MODE << "\n"
              << " BLAZE_SSSE3_MODE    = " << BLAZE_SSSE3_MODE << "\n"
              << " BLAZE_SSE4_MODE     = " << BLAZE_SSE4_MODE << "\n"
              << " BLAZE_AVX_MODE      = " << BLAZE_AVX_MODE << "\n"
              << " BLAZE_AVX2_MODE     = " << BLAZE_AVX2_MODE << "\n"
              << " BLAZE_AVX512F_MODE  = " << BLAZE_AVX512F_MODE << "\n"
              << " BLAZE_AVX512BW_MODE = " << BLAZE_AVX512BW_MODE << "\n"
              << " BLAZE_AVX512DQ_MODE = " << BLAZE_AVX512DQ_MODE << "\n"
              << " BLAZE_MIC_MODE      = " << BLAZE_MIC_MODE << "\n"
              << "\n"
              << " blaze::Abs::simdEnabled<int>() = " << blaze::Abs::simdEnabled<int>() << "\n"
              << std::endl;
    

    The output will give me a detailed understanding of the activated SIMD modes and whether the SIMD abs() function is enabled for int. I hope that this contains the key to understanding why the SIMD abs() function is selected although apparently no SIMD is enabled. I apologize for the extra effort,

    Best regards,

    Klaus!

  4. Shahrzad Shirzad reporter

    Hi Klaus,

    So I added -march=native to CXXFLAGS and the error is gone now. But without adding the flag this is what I get when I run the code you suggested:

     BLAZE_SSE_MODE      = 1
     BLAZE_SSE2_MODE     = 1
     BLAZE_SSE3_MODE     = 0
     BLAZE_SSSE3_MODE    = 0
     BLAZE_SSE4_MODE     = 0
     BLAZE_AVX_MODE      = 0
     BLAZE_AVX2_MODE     = 0
     BLAZE_AVX512F_MODE  = 0
     BLAZE_AVX512BW_MODE = 0
     BLAZE_AVX512DQ_MODE = 0
     BLAZE_MIC_MODE      = 0
    
     blaze::Abs::simdEnabled<int>() = 0
    
  5. Shahrzad Shirzad reporter

    With -march=native added this is the result of the code you suggested to run:

     BLAZE_SSE_MODE      = 1
     BLAZE_SSE2_MODE     = 1
     BLAZE_SSE3_MODE     = 1
     BLAZE_SSSE3_MODE    = 1
     BLAZE_SSE4_MODE     = 1
     BLAZE_AVX_MODE      = 1
     BLAZE_AVX2_MODE     = 1
     BLAZE_AVX512F_MODE  = 0
     BLAZE_AVX512BW_MODE = 0
     BLAZE_AVX512DQ_MODE = 0
     BLAZE_MIC_MODE      = 0
    
     blaze::Abs::simdEnabled<int>() = 1
    

    But I get this error now:

    clang++ -O3 -std=c++17 -stdlib=libc++ -DNDEBUG -fopenmp -fpermissive -march=native -isystem /home/shahrzad/src/blaze/blazetest -isystem /home/shahrzad/src/blaze   -c -o SparseComplexTest1.o SparseComplexTest1.cpp
    In file included from SparseComplexTest1.cpp:42:
    In file included from /home/shahrzad/src/blaze/blaze/math/DynamicMatrix.h:44:
    In file included from /home/shahrzad/src/blaze/blaze/math/DenseMatrix.h:43:
    In file included from /home/shahrzad/src/blaze/blaze/math/adaptors/DiagonalMatrix.h:45:
    In file included from /home/shahrzad/src/blaze/blaze/math/adaptors/diagonalmatrix/Dense.h:74:
    In file included from /home/shahrzad/src/blaze/blaze/math/views/Submatrix.h:88:
    In file included from /home/shahrzad/src/blaze/blaze/math/views/Subvector.h:77:
    /home/shahrzad/src/blaze/blaze/util/SmallVector.h:419:4: error: call to 'destroy' is ambiguous
       destroy( begin_, end_ );
       ^~~~~~~
    /home/shahrzad/src/blaze/blaze/math/expressions/SMatSMatMultExpr.h:491:38: note: in instantiation of member function 'blaze::SmallVector<std::__1::complex<int>, 128, std::__1::allocator<std::__1::complex<int> > >::~SmallVector' requested here
          SmallVector<ElementType,128UL> values ( (~lhs).columns(), ElementType() );
                                         ^
    /home/shahrzad/src/blaze/blaze/math/sparse/CompressedMatrix.h:778:4: note: in instantiation of function template specialization 'blaze::assign<blaze::CompressedMatrix<std::__1::complex<int>, false> >' requested here
       assign( *this, ~sm );
       ^
    /home/shahrzad/src/blaze/blaze/math/adaptors/hermitianmatrix/Sparse.h:729:6: note: in instantiation of function template specialization 'blaze::CompressedMatrix<std::__1::complex<int>, false>::CompressedMatrix<blaze::SMatSMatMultExpr<blaze::HermitianMatrix<blaze::CompressedMatrix<std::__1::complex<int>, false>, false, false>, blaze::CompressedMatrix<std::__1::complex<int>, false> >, false>' requested here
       : matrix_( construct( m, typename IsBuiltin< ElementType_t<MT2> >::Type() ) )  // The adapted sparse matrix
         ^
    /home/shahrzad/src/blaze/blaze/math/expressions/Matrix.h:242:22: note: in instantiation of function template specialization 'blaze::HermitianMatrix<blaze::CompressedMatrix<std::__1::complex<int>, false>, false, false>::HermitianMatrix<blaze::SMatSMatMultExpr<blaze::HermitianMatrix<blaze::CompressedMatrix<std::__1::complex<int>, false>, false, false>, blaze::CompressedMatrix<std::__1::complex<int>, false> >, false>' requested here
       ResultType_t<MT1> tmp( (~lhs) * (~rhs) );
                         ^
    SparseComplexTest1.cpp:6065:12: note: in instantiation of function template specialization 'blaze::operator*=<blaze::HermitianMatrix<blaze::CompressedMatrix<std::__1::complex<int>, false>, false, false>, false, blaze::CompressedMatrix<std::__1::complex<int>, false>, false>' requested here
          herm *= mat;
               ^
    /usr/bin/../include/c++/v1/memory:3278:6: note: candidate function [with _ForwardIterator = std::__1::complex<int> *]
    void destroy(_ForwardIterator __first, _ForwardIterator __last) {
         ^
    /home/shahrzad/src/blaze/blaze/util/algorithms/Destroy.h:66:6: note: candidate function [with ForwardIt = std::__1::complex<int> *]
    void destroy( ForwardIt first, ForwardIt last )
         ^
    1 error generated.
    
  6. Klaus Iglberger

    Hi Shahrzad!

    Thanks a lot, that information was helpful. I can finally reproduce the error. I appreciate your help and patience and will try to resolve the problem(s) as quickly as possible.

    Best regards,

    Klaus!

  7. Klaus Iglberger

    Commits 7d65641 and e9fc567 resolve the two experienced compilation issues. The fixes are immediately available via cloning the Blaze repository and will be officially released in Blaze 3.5.

  8. Shahrzad Shirzad reporter

    Hi Klaus,

    Thank you for the fix now I can build blazetest with openmp backend successfully. For HPX backend I was getting an error which was due to some missing header files in blaze/math/smp/hpx/DenseMatrix.h file, for which I created a pull requested. Could you please give me some instructions on how to run the built tests? I see there is a run executable created in each folder but when I run it, for example for densevector, it just prints

    Running DenseVector functionality tests...
       Running DenseVector operation test...
    

    Is this how you should run these test?

    Best regards, Shahrzad

  9. Klaus Iglberger

    Hi Shahrzad!

    Yes, this is how to run the tests. If it only prints these lines and the test returns EXIT_SUCCESS everything works. If it additionally prints detailed information about an error and returns EXIT_FAILURE there is an error.

    Best regards,

    Klaus!

  10. Shahrzad Shirzad reporter

    Great, so all the tests are pass now, thanks for clarifying it.

    Best regards, Shahrzad

  11. Log in to comment