Comments (5)
If possibe, I would rather just use the right constructor to avoid unnecessary initialisation, i.e.
thrust::device_vector<float> d_c(d_b.cbegin() + 80, d_b.cend());
// or
thrust::device_vector<float> d_c(d_b.cbegin() + 80, d_b.cbegin() + 100);
from thrust.
I am not fully sure what you mean with d_b[80:100]
However, you could always use one of the algorithms such like https://github.com/NVIDIA/thrust/blob/main/thrust/fill.h
from thrust.
I am not fully sure what you mean with
d_b[80:100]
However, you could always use one of the algorithms such like https://github.com/NVIDIA/thrust/blob/main/thrust/fill.h
I mean fill thrust vector with d_b from the 80'th to the 100'th values.
from thrust.
In that case you would need to use thrust::copy
or thrust::copy_n
You can find some documentation here
Lines 118 to 130 in 125d281
from thrust.
this can work for u:
- device vector is already with some values
int main()
{
int size = 299;
int d_b[299];
thrust::device_vector d(d_b, d_b + size);
thrust::device_ptr d_ptr = thrust::make_device_ptr(d_b);
thrust::device_vector d_subset(d_ptr + 66, d_ptr + 299);
return 0;
}
from thrust.
Related Issues (20)
- strided sum of a vector HOT 2
- `thrust::device_vector` should have an `std::initializer_list` constructor HOT 1
- `thrust::complex` divided by `int` HOT 2
- Mistake
- building thrust with clang cuda fails at target_compile_features HOT 10
- Documentation behind `#if 0` HOT 3
- Godbolt examples in the README fail to compile HOT 1
- [EPIC] Thrust Documentation Improvements HOT 1
- cannot build without thread API HOT 10
- Can thrust support device segmented sort?
- thrust::reduce doesn't work with cuda::proclaim_return_type HOT 1
- Compilation error with iterator_adaptor HOT 2
- Fix failing libcxx tests
- nvcc fatal : Unsupported gpu architecture 'compute_90' for $ cmake --build . -j ${NUM_JOBS} HOT 4
- Make libcu++ compile with gcc-6
- Modify Device Value Error in Official Doc Codes HOT 1
- Shadow warning in execute_with_dependencies
- `sequence` not modifying device array of `cuComplex` HOT 1
- Under what conditions does the reduce function would cause core dump? HOT 1
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 thrust.