Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression Templates #11

Open
bassoy opened this issue May 28, 2018 · 2 comments
Open

Expression Templates #11

bassoy opened this issue May 28, 2018 · 2 comments
Assignees
Labels
discussion Discussion for future refactoring gsoc Google Summer of Code

Comments

@bassoy
Copy link
Collaborator

bassoy commented May 28, 2018

Expression templates are used in uBLAS for avoiding temporary objects to be generated and copied in expressions, finally to reduce the runtime of such expressions.

However, with C++11 and C++14 standards copy elision is possible where the copy and move constructors can be omited by the compiler, resulting in zero-copy pass-by-value semantics. The C++17 standard even guarantees copy elision.

Moreover, the current implementation of matrix-vector and matrix-matrix products in expressions are implemented in a row-by-column style where the spatial and temporal data locality are not preserved for the sake of avoiding temporary objects.

Does this really help to reduce the runtime costs?

@bassoy bassoy added the discussion Discussion for future refactoring label May 28, 2018
@stefanseefeld
Copy link

I'm not entirely sure I understand the question, or at least, the scope of the question.
Are you asking whether expression templates are useful for Boost.UBlas ? Or are you asking about a specific implementation of matrix/vector and matrix/matrix products ?

(As to your point about expression templates, I don't think that the availability of return-value optimizations renders them useless, as their use goes far beyond the elision of temporaries.)

@bassoy
Copy link
Collaborator Author

bassoy commented May 29, 2018

I am asking whether expression templates are useful for Boost.uBlas as they are implemented right now.

@bassoy bassoy added the gsoc Google Summer of Code label Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion for future refactoring gsoc Google Summer of Code
Projects
None yet
Development

No branches or pull requests

3 participants