Comments (5)
In the process I introduce some "element_accessor" in addition of the index set... This allows for some memory-less patterns to be used, such as an "infinite" vector 1,2,3,..... , repmat, diag, etc...
Is there any additional cool feature that can be done using this mechanism, for cases where the elements of the vector don't come from an handle (or not only) ?
from viennacl-dev.
Please be more conservative with respect to features. Now as the generator is no longer super-experimental, we have a hard time removing features once they are introduced. ;-) Could you please elaborate more on what exactly 'element_accessor' is supposed to do (other than what is provided by range(), slide(), and finally index_set()?
from viennacl-dev.
element_accessor, is just a way to specify where the elements of a given vector is located, because it may not come necessarily from a handle, for example, a constant vector would implement something like
std::string constant_element::access(index){ return val_name_; }
where val_name_ is the argument name of the corresponding CPU scalar. Or a vector 1,2,.....,N would be like
std::string linear_element::access(index){ return index; }
We can play a bit with matrices to introduce "memory free" r-value symbolic expressions :P For example, eye(N) would map to something like:
std::string identity_element::access(index1, index2){ return "(" + index1 + ")==(" + index2 + ")";
The idea is just that diag() would dispatch the access to a diag_accessor, that would be for example implemented like
std::string diag_mat_element::access(index1, index2){ return vec_handle_name_+"["+index1+"]"; }
At first I wanted to incorporate this information in index_set, but it seemed like an orthogonal issue :) This is used internally only so I wouldn't describe this as a "feature"
from viennacl-dev.
I have reimplemented diag() and also repmat()... A "pitfall" of the "element_accessor" approach is that diag() and repmat accept only single elements and not expressions :P diag(x + y) is not legal (but can be replaced by diag(x) + diag(y) ).
from viennacl-dev.
Cool, thanks! What about still allowing the user to pass an expression, but internally immediately convert it to the expanded form.
Example: User writes diag(A + alpha * B), we transform this immediately to diag(A) + alpha * diag(B);
from viennacl-dev.
Related Issues (20)
- Unable to run tutorial amg HOT 1
- Filter for OpenCL context creation
- cuda-10.1 support HOT 2
- Iterative Solvers - Matrix Output? HOT 2
- Copying Eigen Matrix (host) to vcl_matrix (device) HOT 3
- Blaze lib support HOT 1
- Copying values in parallel HOT 3
- I have a problem with spai HOT 2
- Cannot compile against CUDA 9.1 on Ubuntu 18.04 HOT 4
- Tuning Lanczos to find all eigenvalues of a dense Hermitian matrix HOT 2
- Question about compute SPAI HOT 1
- Get CL_PLATFORM_NOT_FOUND_KHR when clGetPlatformIDs() is called in viennacl HOT 5
- How to achieve partial synchronization? HOT 5
- [Feature Request] range class modification after initialization HOT 1
- [Tutorial Request] Elementwise Operation HOT 10
- [Operator Missing]matrix_base += & -= float value HOT 3
- tests fail on AArch64, Fedora 33 HOT 6
- Viennacl failed to build with cuda-11.0
- error about wrap a viennacl vector with an existing device vector. HOT 1
- Assessment of the difficulty in porting CPU architecture for viennacl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viennacl-dev.