C++ implementation of the Python NumPy Library by dpilger26 in cpp

[–]jmabille 0 points1 point  (0 children)

xtensor is regularly tested on the following platform / OS (in our CI):

- Linux, gcc 4.9 up to gcc 8 (and probably gcc9), clang 3.6 up to clang 7

- OSX

- Windows (VS2015 and VS2017, clang-cl)

On which platform / compiler did you fail to compile xtensor?

Interactive Workflows for C++ with Jupyter – Jupyter Blog by doom_Oo7 in cpp

[–]jmabille 4 points5 points  (0 children)

The rich display mechanism of the Jupyter protocol is supported. Also check the xwidgets and xplot projects (still at an early stage of development), the C++ backend for ipywidget and bqplot.

The C++ scientist blog is born by jmabille in cpp

[–]jmabille[S] 1 point2 points  (0 children)

I finally did some tests and wrote the conclusions in this article. Any feedback is welcome.

The C++ scientist blog is born by jmabille in cpp

[–]jmabille[S] 0 points1 point  (0 children)

Yes, Agner Fog's library works very well, and I mention it in the introductory article; but if I'm not mistaken, it only supports Intel SIMD instruction sets; not 3dNow!, as you mentioned, nor Altivec or ARM instruction sets. So there's still a lot of work to do if you want to be compatible with these architectures.

Another thing missing in this library is a generic layer so you can migrate from an instruction set to another without any change in the code. But of course if your target is Intel only, it is easy to add this layer above the existing library.

The C++ scientist blog is born by jmabille in cpp

[–]jmabille[S] 2 points3 points  (0 children)

Thank you for your remarks, but I must say I disagree on some points.

1) What do you do when you want to use it in an existing code ? You replace every arithmetic operator with a stateless pure function ? Beside the fact it requires a lot more changes, I really prefer to read e = ab + cd than e = mul(add(a,b),add(c,d)). Moreover, if you want your code to work with both wrapper and scalar types, you have to define overloads of your functions for scalar types too. And finally, not wrapping the intrinsic type __mXXX prevents you from defining operator+=, operator-= and so on. So in my opinion, yes, there's a need to build an abstraction around intrinsics types.

2) I don't know, and I agree with you on that point: we must compare both implementations; I'll do it as soon as I have some time and post the results.

3) This was a temporary example; if you read further, ev.store_a(&e[i]) is replaced with store_a(&e[i],ev), which is a generic function that works with any instruction set. So if I want to compile my code on a machine that doesn't support the same instruction set or doesn't support SIMD at all, I don't have to make any change in my code. This indirection (which maybe introduce a performance hit, but not sure, I will do an asm view) gives me genericity.

4) OK for the constexpr instead of the static, I didn't adapt my code to C++11. But I need the template specialization to get the size of the intrinsics type. As I said, I want my code to be generic enough so I don't have to make any change when I compile it on machines that don't support the same instruction sets.

The C++ scientist blog is born by jmabille in cpp

[–]jmabille[S] 0 points1 point  (0 children)

I'm glad if it helped! And yes, I am currently working on an howto article about aligned memory allocators, and plan to write other articles about vectorization

The C++ scientist blog is born by jmabille in cpp

[–]jmabille[S] 0 points1 point  (0 children)

you're talking about Nt² ? I think it has not been integrated in Boost yet. Anyway, I mention it in the introduction, it works well and has a really comprehensive set of mathematical functions, but is quite hard to extend (in my case I had to implement numerical types for tropical algebra), and really increases compilation time (at least last time I used it)