4 ms·
> But it even still have a comprehensive numeric library [1]. I think, by number crunching, they may mean blas/lapack, which is nowhere near replaced by that n
by sseagull 9y ago
> But it even still have a comprehensive numeric library [1].
I think, by number crunching, they may mean blas/lapack, which is nowhere near replaced by that numeric library...
>> C++ has pointer aliasing shenanigans, so it's hard to make it as efficient as Fortran
>I don't know how this could be the case (especially with the addition of shared pointer) but you shouldn't be writing code with huge shared memory dependencies. Use constexpr, use inline, and use functions. There's no need for 20 functions to have shared memory access to a piece of data (which I have seen scientists do).
Not sure you are understanding what is meant by pointer aliasing. Explicitly marking pointer arguments as 'restrict' in C can have a pretty dramatic speed benefit as the compiler can assume that the memory spaces do not overlap. C++ does not (strictly) have such a feature, unfortunately, and I don't see how shared_ptr/constexpr can fix this (although inline might in some cases)
- flamedoge 9y agorestrict is pointer qualifier. Reference, even const reference doesn't have restrict-like promise. So potential for overlap still kills C++ speed.