9il on master
Replace deprecated `do` keyword… (compare)
*._lengths
parameter is public and accessible. Please fill issue if it does not. _lengths.length
can be used instead of N. *._lengths
are mutable. http://docs.algorithm.dlang.io/latest/mir_ndslice_slice.html#.Slice._lengths*.shape
, and *.shape.length
, http://docs.algorithm.dlang.io/latest/mir_ndslice_slice.html#.Slice.shapeisSlice!T[0]
returns the same value as *.shape.length
. http://docs.algorithm.dlang.io/latest/mir_ndslice_slice.html#.isSlicemir.ndslice
, I was going to port a simple lattice Boltzmann fluid dynamics simulation for learning purposes, starting with a collision kernel:auto uxv = ux[i];
ldmd2 -inline -O -enable-cross-module-inlining -release -boundscheck=off -I mir-algorithm/source/ -output-s matrix_copy.d
ldc2 --version
LDC - the LLVM D compiler (1.3.0git-a969bcf):
based on DMD v2.073.2 and LLVM 4.0.0
built with LDC - the LLVM D compiler (0.17.5git-64a274a)
Default target: x86_64-apple-darwin16.5.0
Host CPU: haswell
http://dlang.org - http://wiki.dlang.org/LDC
opIndex
calls don't get inlined, which is expensive by itself and also prohibits all further optimization via alias analysis and ultimately vectorization.
a[i][j]
style indexing improved the performance by about 2x, but it's still ~720ms vs 30ms.
dub.selections.json
and update mir-algorithm version upto ~>0.6.2
if you use dub.
"dflags-ldc":["-mcpu=native"]