Comments (3)
the direct use of std::size_t instead of vcl_size_t is only a lack of unification after the vcl_size_t typedef was introduced. I consider this to be the necessary task associated with this issue.
The use of unsigned int, however, is intentional when dealing with sparse matrices for now. The reason is that size_t may differ on the host and on the GPU, hence one cannot use size_t for both and has to fall back to integer types.
from viennacl-dev.
And unsigned int
is the same on both? How can that be? Isn't sizeof(int)
quite dependent on the compiler and the target arch (32bit or 64bit)? And wouldn't it maybe sth different on the GPU, like always 32bit or so? (Just curious because I never did GPU programming.)
from viennacl-dev.
OpenCL defines the type 'cl_uint', which is guaranteed to be the same on both the host and the device. For all operations on OpenCL buffers, there is actually a lot of extra logic in place to make sure things get converted to the correct types.
However, 'cl_uint' is not necessarily available on the OpenMP backend, because OpenCL might be switched off. For this reason, 'unsigned int' is consistently used for indices for buffers in CPU RAM. Similarly, 'unsigned int' is controlled by the CUDA compiler to be the same on the host and on the device, hence we considered this to be the most consistent way of dealing with stuff.
On a related note: We make the index type a global typedef just like vcl_size_t so that user codes dealing with signed integer indices can better interface without the need for (potentially costly) conversions...
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.