Re: [eigen] [RFC] Tensor module: class hierarchy

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Christian,

I have been working on extending the Tensor class quite a bit in http://bitbucket.org/benoitsteiner/eigen and I am reaching the point where the code is almost ready to be useful.

What I have:
 * Support for dynamically sized and statically sized tensors as well as tensor map
 * Support for many tensor expressions (unary cwise, binary cwise, select, contractions, and convolutions)
 * Support for cxx11 with a fallback on cxx03 for compilers such as nvcc that don't support cxx11.
 * Support for automatic parallelization across multiple cpu cores and/or offloading to gpu through devices. The _expression_ A = B + C; can be offloaded on gpu by calling A.device(my_gpu) =  B + C; or parallelized over multiple cpu cores  A.device(my_thread_pool) =  B + C;

I have reused the existing Eigen codebase as much as possible, which gives me for free:
  * Vectorization leveraging SSE/AVX
  * Primitives for tensor operations (addition, exponentiation, ...)
I didn't reuse the Eigen _expression_ mechanism since it assumes that arrays/matrices are 2D object, but I tried to follow the pattern as much as possible.




On Sun, Jun 8, 2014 at 4:26 AM, Christian Seiler <christian@xxxxxxxx> wrote:
Hi there,

I am currently working on the tensor module to try to make it more
useful. (In case you are not familiar with it: I put some introductory
words in the wiki: [1])

The current state is: it basically only stores data for now.

My goal for the immediate future is to implement a class hierarchy
similar to that which Eigen uses itself. This will then allow me to
introduce some basic expressions such as adding two tensors etc, which
will immediately make the tensor module quite a bit more useful than
beforehand.

My problem here is that I have some conceptual questions I'd like to
discuss before proceeding. I've documented the details under:
http://eigen.tuxfamily.org/index.php?title=Working_notes_-_Tensor_module

Basically I have three immediate things I'd like to have feedback on:

1. the names of the new class hierarchy: do you agree or do you have
   better ideas?

2. packet access for tensors: should I just deviate from Eigen by
   changing the argument order of writePacket for tensors or should
   writePacket() for tensors only accept std::array for index
   specification? (see wiki page for an explanation)

3. _expression_ template names: is it possible to somehow reuse the
   CwiseBinaryOp etc. names for tensors (obviously with a different
   implementation behind it) or do I have to go the way of
   TensorCwiseBinaryOp?

Any other general comments / ideas / suggestions are of course also welcome..

Thank you!

Regards,
Christian

[1] http://eigen.tuxfamily.org/index.php?title=Tensor_support





--
Benoit


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/