July 24, 2016
On Saturday, 23 July 2016 at 23:36:40 UTC, Etranger wrote:
> is there any good benchmarking lib like the #[bench] in rust that I can use ?)

dunno, i'm usually just using std.datetime.benchmark.
July 24, 2016
On Saturday, 23 July 2016 at 11:05:57 UTC, Etranger wrote:

> 1- Is there a cleaner way to do it ? I had to use struct because I want every thing to happen at compile time and on the stack (without gc). And I had to use string mixins because template mixin does not work the way I tried to use it ( see the error last line).

Yes, but it is more complicated in terms of multidimensional and generic abstraction.
First we need to finish and test general matrix multiplication [2].

> 2- Is there a safer way to do it (without using pointers) ?

Yes, but it is slower than pointers. See Internal Binary Representation for Slice structure [1]. Mir's BLAS will use pointers.

> 3- Do you think I'll hit a wall with this approach ?

No idea. In the same time I think that C++ approach is not flexible as we can build for D.
Currently we need std.algorithm analog for multidimensional case. It would be more flexible than expression templates. But it requires more complex architecture analysis.

> 4- Do you known any D libs that uses expression template for linear algebra ?

I don't know. ndslice provides operations like `a[] += b` [1]. I just opened a PR to optimise them using SIMD instructions [4]. Mir BLAS will have more low level API for matrix multiplication then Eigen. See PR for gemm [2]. Expression like API can be build on top of Mir's BLAS.

> I'll be very happy if I could contribute something useful for the D community :)

That would be great! See Mir's issues [3]. Feel free to open new one and start a discussion or open PR. Mir requires a lot of benchmarks, for example versus Eigen. Just Eigen benchmark of Level 3 BLAS functionality (like matrix multiplication) with proper CSV console output would very helpful. See current charts [5] and [6]

[1] http://dlang.org/phobos/std_experimental_ndslice_slice.html#.Slice
[2] https://github.com/libmir/mir/pull/255
[3] https://github.com/libmir/mir/issues
[4] https://github.com/dlang/phobos/pull/4647
[5] https://s3.amazonaws.com/media-p.slid.es/uploads/546207/images/2854632/Untitled_2.004.png
[6] https://s3.amazonaws.com/media-p.slid.es/uploads/546207/images/2854640/Untitled_2.006.png

Best regards,
Ilya
July 26, 2016
On Sunday, 24 July 2016 at 10:53:41 UTC, Ilya Yaroshenko wrote:
> On Saturday, 23 July 2016 at 11:05:57 UTC, Etranger wrote:
>
>> [...]
>
> Yes, but it is more complicated in terms of multidimensional and generic abstraction.
> First we need to finish and test general matrix multiplication [2].
>
> [...]

Thanks allot for your suggestions. I started looking into the ndslice and mir code. For me it seems that there is an urgent need to have a better benchmarking (like rust bench or google benchmark framework for cpp) framework than what is available. I can may be look into it.

I'll have time 2 months from now as I'm getting married in 2 weeks :)
July 26, 2016
On Saturday, 23 July 2016 at 23:55:44 UTC, ag0aep6g wrote:
> On 07/23/2016 01:05 PM, Etranger wrote:
>> [...]
>
> To avoid the string mixin, you can let VecExpression take an alias of the mixin template (Vec_impl/VecSum_impl) and the list of arguments:
>
> [...]

Thanks ! that's way much cleaner and the type strictness loss is not a problem since it is what I want.
July 26, 2016
On Tuesday, 26 July 2016 at 10:35:12 UTC, Etranger wrote:
>
> I'll have time 2 months from now as I'm getting married in 2 weeks :)

Congratulations!


1 2
Next ›   Last »