Questions tagged [thrust]

Thrust is a template library of parallel algorithms with an interface resembling the C++ Standard Template Library (STL) for NVIDIA CUDA.

Thrust is a library of parallel algorithms with an interface resembling the C++ Standard Template Library (STL) which interoperates with technologies such as CUDA, OpenMP, and TBB. Thrust provides a flexible high-level interface for parallel programming designed to greatly simplify running common data parallel processing tasks on GPUs and multicore CPUs, with the intention of enhancing developer productivity.

As of CUDA release 4.0, a Thrust snapshot is included in every release of the the standard CUDA toolkit distribution. Under Debian and Ubuntu Thrust may also be installed through apt-get:

sudo apt-get install libthrust-dev

The project homepage contains documentation and sample code demonstrating usage of the library. The latest source, bug-reports and discussions are always available on GitHub.

The rocThrust project (GitHub) by AMD is a port of Thrust to their HIP/ROCm platform.

959 questions
-3
votes
1 answer

merge list with duplicate keys in CUDA

Suppose we have a list of structs graph_node*: struct graph_node{ int from; int to; float prob; } Now, suppose several .from and .to elements are repeated in the list. For example: we can have two nodes with the same .from and .to attributes…
user1730250
  • 582
  • 2
  • 9
  • 26
-3
votes
1 answer

Sorting with thrust library on gpu

I work on stereovision and I have a problem with sort from te Thrust library. When I use it in my kernel function, the application run and bug because all the kernels aren't launch in my <<< >>> call but when I remove the sort all works (but the…
-3
votes
1 answer

How to efficiently insert/merge into thrust::device_vector?

I'd like to merge several device_vectors into one, like so: thrust::device_vector allinput =…
hsvar
  • 177
  • 4
  • 14
-3
votes
1 answer

Debugging incomplete type errors with thrust

I've had a bunch of thrust debugging to do with unary_function and binary_functions but and I've managed to hunt them don. All but one and incomplete type error in yes_type in: namespace is_assignable_ns { template class…
-3
votes
1 answer

using thrust for statistics , compilation errors

I want to compute mean and std using thrust and I found this code. I am trying to use complex values and I am having some problems. Here is the code: #include #include #include…
George
  • 5,808
  • 15
  • 83
  • 160
-3
votes
1 answer

Unresolved external symbol during linking CUDA program with Thrust

I created a simple program using some Thrust library functions, but recieve a link error Unresolved external symbol on templated function. I use VS2010. Here is my code. func.cuh #pragma once #include #include…
lexxa2000
  • 9
  • 5
-3
votes
1 answer

Cuda cannot run more than 1024*255 Threads

I am running on Amazon's K520 GPU with 1500 cores and 4GB RAM. I am trying the run a kernel with 1024*850 threads. I know I can only get up to 1024 threads per block, but it surprised me when I could not launch more than 255 blocks using 1024…
Eric Kulcyk
  • 279
  • 3
  • 15
-3
votes
1 answer

Programming bsxfun at CUDA via CUBLAS or THRUST?

I have a vector V that has nx1 items and a matrix M that has nxm item. I want to sum V with all the columns of M with CUDA. Is there any method in THRUST or CUBLAS that can help me to get away the problem?
erogol
  • 13,156
  • 33
  • 101
  • 155
-3
votes
1 answer

Thrust is so slow as finding max and min of an array?

Here is my kernel call code by thrust inline void find_min_max(thrust::device_vector dev_vec, Npp8u *min, Npp8u *max){ thrust::pair::iterator,thrust::device_vector::iterator> tuple; tuple =…
erogol
  • 13,156
  • 33
  • 101
  • 155
-4
votes
1 answer

Using strided iterator to find unique arbitrarily-size tuples in Thrust

I'm trying to write Thrust code that finds unique tuples in a collection, but with one important caveat: the application should be able to handle tuples of arbitrary dimensions i.e. unknown at compile-time. Furthermore, the size of the tuple may…
Olumide
  • 5,397
  • 10
  • 55
  • 104
-4
votes
4 answers

overload operator [ ] to enable element assignment

I've already overloaded operator [ ] to enable element access. definition double Matrix::operator[ ](const & int i){ return data[i]; // data[] is a member array: thrust:: device_vector } usage Matrix m = ... // initialize std::cout << m[3] <<…
user2684645
  • 501
  • 1
  • 7
  • 15
-5
votes
1 answer

Cross Platform GPU Computing

Recently gone through Thrust. Is it cross platform? If it is how do I build it? I couldn't find any documentation related to build thrust.Can anyone shed any light on this? Alternatively, does anyone know of any other C++ libraries that support…
jhon
  • 1
-5
votes
1 answer

Using thrust is slower than my own kernel?

EIDT Change the code as Robert suggested, but thrust is still much slower. The data I used is based on two .dat files, so I omit it in the code. Original problem I have two complex vectors which have been put on GPU Tesla M6. I want to compute…
DerekLu
  • 79
  • 2
  • 7
1 2 3
63
64