970 questions
1
vote
0
answers
86
views
using boost odeint with thrust complex
I'm trying to use controlled stepper in boost odeint with thrust::host_vector container and thrust::complex<double> data type. The following code compiles when I use std::vector and std::complex&...
1
vote
0
answers
78
views
Coupling arrayfire with boost::odeint
I wrote a function incorporating several calls to 2d-ffts and matrix-vector-multiplications in C++, using arrayfire, such that I can run and compile the program both on the CPU and GPU. Reason for ...
0
votes
1
answer
609
views
Efficient way to reduce a subset of vector using thrust/cuda
Let us say, we have a thrust device vector of size 10^16 and another vector of size 10^8 containing some indices (not necessarily sorted). We want to sum all the elements of the first vector if it's ...
1
vote
1
answer
263
views
How to know how many elements are in the result of thrust::partition_copy
I am trying to partition an array with the thrust library's partition_copy function.
I have seen examples where pointers are passed, but I need to know how many elements are in each partition.
What ...
1
vote
2
answers
882
views
Change the values of some elements according to the index using thrust
Problem description:
I want to use thrust to set the value of some elements in an array based on another index array. One simple example is shown below:
// input:
int array[10] = {1,9,9,6,0,1,1,6,1,...
2
votes
1
answer
1k
views
Using Thrust Functions with raw pointers: Controlling the allocation of memory
I have a question regarding the thrust library when using CUDA.
I am using a thrust function, i.e. exclusive_scan, and I want to use raw pointers. I am using raw (device) pointers because I want to ...
1
vote
1
answer
477
views
how can I implement an external trait on an internal trait in Rust?
I want to print the instance of Tweet datatype in main function, but the summary trait don't implement the debug trait. Is there any way to implement a trait on trait or any work around.
...
-2
votes
1
answer
54
views
Thrust code returns different results when compiled with OpenMP backend
I am experiencing on Windows 10 a situation in which the same code, either compiled with CUDA 9.2 backend (using nvcc with cl.exe) or compiled with OpenMP backend (using g++ provided by MinGW), ...
1
vote
1
answer
147
views
Thrust CUDA compute index for each segment in an array
I have an array of int which serves as keys in my application. This is already sorted. I want to assign each unique key a unique index starting from 0. How would I do that in cuda using thrust?
...
0
votes
2
answers
1k
views
Why does thrust::device_vector not seem to have a chance to hold raw pointers to other device_vectors?
I have a question that I found many threads in, but none did explicitly answer my question.
I am trying to have a multidimensional array inside the kernel of the GPU using thrust. Flattening would be ...
3
votes
1
answer
434
views
How to format thrust::copy(ostream_iterator)
Summary
I am printing device vectors using this example. I would like to have the arrays line up.
Format settings are only being applied to the first number.
My Code
template <typename ...
-1
votes
1
answer
265
views
Multiway stable partition
Is there a way to perform multiway (>2) stable partition in Thrust?
Either stable partition or stable partition copy both are equally interesting. Currently I can only use two-way stable partition ...
3
votes
1
answer
478
views
How to implement thrust::transform with custom functor that skips part of device_vector?
I am working on a project (essentially a physics simulation) in which I need to perform calculations on a large number of nodes over many time steps. I have currently implemented each type of ...
0
votes
1
answer
151
views
How to reorder subarrays of fixed size inside a big 1D array in Thrust
I have 100000 arrays that are stored in a big 1D array.
The size of each array is L =1000 and are ordered in descending order order.
Each array is divided in m=5 segments.(S1,S2,S3,S4,S5)
For ...
0
votes
1
answer
148
views
Conditional copying in CUDA, where data vector is longer than stencil
I would like to conditional copy data from vector, basing on stencil vector, which is N times shorter. Every element in stencil would be responsible for N elements in data vector.
Suppose that the ...
1
vote
1
answer
4k
views
CUDA: how to do a matrix multiplication using thrust?
I'm new to CUDA and Thrust and I'm trying to implement a matrix multiplication and I want to achieve this by only using the thrust algorithms, because I want to avoid calling a kernel manually.
Is ...
0
votes
1
answer
273
views
How do I use boost.compute functions in a functor which will be used by Thrust on a GPU?
I'm trying to use a special function provided by boost.math in a thrust algorithm.
Basically, I want to do a transformation, like so
thrust::device_vector<double> in(1000);
thrust::...
1
vote
1
answer
1k
views
How to compute complex vectors' inner product using cublas or thrust?
After searching a long time, I still can't solve this problem.
I have two vectors: x = [a1,...,aN], y = [b1,...,bN].
And I want to compute their inner product: = a1*conj(b1) + ... + aN*conj(bN). (...
0
votes
1
answer
463
views
Problem when using thrust::iterator_adaptor on a device_vector
I am working on defining an iterator_adaptor based on a base iterator.
The whole thing works when working on host_vectors, but when I apply it to device_vectors, the compiler throws an error: initial ...
1
vote
1
answer
390
views
CUDA Sorting Many Vectors / Arrays
I have many (200 000) vectors of integers (around 2000 elements in each vector) in GPU memory.
I am trying to parallelize algorithm which needs to sort, calculate average, standard deviation and ...
3
votes
1
answer
2k
views
Having thrust::device_vector in global scope
I'm writing a program that calculates a lot of properties of triangle mesh data. Some of these properties, I'd like to calculate using thrust:: methods, other properties need to be calculated using ...
0
votes
1
answer
2k
views
Count number of unique elements using thrust unique_by_key when the set of values is a tuple
I am trying to use thrust::unique by key to find unique set of values. However I am using a tuple for the values. The key is of type int, the tuple if type (float, int).
My code as below works fine ...
0
votes
0
answers
424
views
thrust::device_vector constructor failed with "invalid device function" [duplicate]
I encountered a strange error when trying to construct a thrust::device_vector<unsigned char> using thrust::device_vector<unsigned char> data(10). The error was "parallel_for failed: ...
0
votes
1
answer
369
views
Unable to compile thrust code using reduce_by_key
I need to minimum values along columns of a matrix along with row indices using thrust. I use the following code (copied from orange owl solutions), However I get errors while compiling. I have posted ...
-2
votes
1
answer
142
views
Scope operator needed to find std namespace instead of boost
I am working on porting parts of the boost library to compile under cuda / nvcc as device functions. This involves using the thrust library for some things like iterators, arrays, etc. One issue I am ...