Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Simple Test Program #60

Closed
jbarnett8 opened this issue Jul 10, 2017 · 1 comment
Closed

Compiling Simple Test Program #60

jbarnett8 opened this issue Jul 10, 2017 · 1 comment

Comments

@jbarnett8
Copy link

Hello!

I tried compiling the simple test program you include in your documentation

#include <iostream>
#include "xsimd/xsimd.hpp"

namespace xs = xsimd;

int main(int argc, char* argv[])
{
    xs::batch<double, 4> a(1.5, 2.5, 3.5, 4.5);
    xs::batch<double, 4> b(2.5, 3.5, 4.5, 5.5);
    auto mean = (a + b) / 2;
    std::cout << mean << std::endl;
    return 0;
}

I compile using
g++ -std=c++14 -o out -I xsimd/include/ main.cpp
where gcc is version 5.4.1 .

I get the following error

In file included from xsimd/types/xsimd_types_include.hpp:15:0,
                 from xsimd/types/xsimd_traits.hpp:12,
                 from xsimd/xsimd.hpp:14,
                 from main.cpp:2:
xsimd/types/xsimd_sse_int32.hpp: In function ‘xsimd::batch<int, 4ul> xsimd::select(const xsimd::batch_bool<int, 4ul>&, const xsimd::batch<int, 4ul>&, const xsimd::batch<int, 4ul>&)’:
xsimd/types/xsimd_sse_int32.hpp:441:70: error: ‘s’ was not declared in this scope
         return _mm_or_si128(_mm_and_si128(cond, a), _mm_andnot_si128(s, b));
                                                                      ^
In file included from xsimd/types/xsimd_types_include.hpp:16:0,
                 from xsimd/types/xsimd_traits.hpp:12,
                 from xsimd/xsimd.hpp:14,
                 from main.cpp:2:
xsimd/types/xsimd_sse_int64.hpp: In function ‘xsimd::batch<long int, 2ul> xsimd::select(const xsimd::batch_bool<long int, 2ul>&, const xsimd::batch<long int, 2ul>&, const xsimd::batch<long int, 2ul>&)’:
xsimd/types/xsimd_sse_int64.hpp:460:70: error: ‘s’ was not declared in this scope
         return _mm_or_si128(_mm_and_si128(cond, a), _mm_andnot_si128(s, b));
                                                                      ^

I'm sure it's something simple I'm missing.

Thanks!

@JohanMabille
Copy link
Member

JohanMabille commented Jul 10, 2017

Hi,

You're not missing anything, it is a typo in xsimd. We did not detect it since it happens only when SSE4.1 is not available, which does not seem to be the case for the processors used for the CI.

Thanks for catching it! I make a fix asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants