Questions tagged [boost-compute]

Boost.Compute is a GPU/parallel-computing library for C++ based on OpenCL with STL-like interface.

The core library is a thin C++ wrapper over the OpenCL API and provides access to compute devices, contexts, command queues and memory buffers. On top of the core library is a generic, STL-like interface providing common algorithms (e.g. transform(), accumulate(), sort()) along with common containers (e.g. vector<T>, flat_set<T>). It also features a number of extensions including parallel-computing algorithms (e.g. exclusive_scan(), scatter(), reduce()) and a number of fancy iterators (e.g. transform_iterator<>, permutation_iterator<>, zip_iterator<>)

More information on Boost.Compute can be found here:

Notable alternatives for Boost.Compute:

31 questions
1
vote
1 answer

What is the fastest way of Boost::compute vector partial sum

I have a vector of 10M float. I want to know sum of every 100 elements, so 10000 sums in total. What is the fastest way to do this?
Zeta
  • 913
  • 10
  • 24
1
vote
0 answers

OpenCL for signal processing

I'm looking to write signal processing code that will need the usual parallel primitives (e.g., scan(), reduce(), map(), and sort()) along with efficient routines for FFTs and dense vector/matrix operations to support stuff like principal component…
1
vote
1 answer

How to use Shared Virtual Memory in Boost::Compute and custom kernel?

I have written a simple kernel that performs recursion over trees like: struct item { int data; item *rnext, *lnext; } *items[NUM_ITEMS]; So i'd like to pass such array of tree items which point to themselves to the opencl kernel, and SVM…
Troy McClure
  • 389
  • 2
  • 4
  • 10
1
vote
1 answer

Install Boost.Compute on Mac OS

I'm following this link and trying to install Boost Compute on Mac OS. It says it can be installed with make install but I cannot find a Makefile. I added the path to the boost-compute folder to the header search path in the Xcode project. But now…
ethanjyx
  • 1,970
  • 7
  • 28
  • 50
0
votes
0 answers

Unexpected results for addition big numbers with carry on GPU (OpenCL)

I am writing a function to add numbers of arbitrary length on GPU using OpenCL and Boost::compute as frontend. No error occurs when the numbers are not so big (4096 bits): Bits length: 4096 Limbs Size: 65 Result: [03, ffffffffffffffff,…
JML
  • 1
  • 2
0
votes
0 answers

How to implement a nested algorithm using boost::compute?

The documentation demonstrates nicely how to compose trivial function objects to be passed to any algorithm provided by boost::compute. There is also a link provided [Custom OpenCL functions in C++ with Boost.Compute][1] which is dead meanwhile. The…
Frank Puck
  • 467
  • 1
  • 11
0
votes
1 answer

Is there a way to load a vector equal by size to global memory size of GPU in OpenCl?

My GPU has 12 GB global memory (CL_DEVICE_GLOBAL_MEM_SIZE), but only 3 GB of memory which it can allocate (CL_DEVICE_MAX_MEM_ALLOC_SIZE). When I try to load a vector of size exceeding 3 GB, the program crashes. The question is, if it is possible to…
Stepan Pavlov
  • 119
  • 2
  • 3
  • 7
0
votes
0 answers

Is there a For-loop in Boost.Compute?

I am trying to do the following: Declare and initialise a compute::vector of size n with each of the element being 1^2, 2^2, 3^2 ... n^2 While size of vector > 1: a. For i = 0 to (size of vector - 1): n[i] += n[i+1] b. Remove the last element from…
Arkyo
  • 307
  • 1
  • 2
  • 13
0
votes
1 answer

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 in(1000); thrust::device_vector out(1000); …
fiziks
  • 247
  • 2
  • 5
0
votes
2 answers

boost::compute, passing pointer to a closure

Good evening! I am writing a high-performance application and trying to use boost to speed up complex computations. The essence of my question: is there a way to pass an external pointer to array (like float4_ *) to a BOOST_COMPUTE_CLOSURE? I'd like…
0
votes
3 answers

How to use boost::compute::atan2?

I would like to compute the phase of a complex number using boost::compute here is my attempt, I expect the result to be equal to atan2(0.5f): namespace bc = boost::compute; bc::vector> vec{ {1.0f, 2.0f} }; bc::vector
Elad Maimoni
  • 3,703
  • 3
  • 20
  • 37
0
votes
0 answers

Boost Compute buffer deconstructor behaving differently on different OS

I'm having an issue with a bit of boost compute code that I have running on two machines. My dev machine is running windows 7 using a radeon WX9100 gpu, and everything is running fine. Another lab machine I am using is nearly identical, but is…
0
votes
1 answer

Allocating large vectors in boost::compute

While experimenting with boost::compute I've run into an issue with determining the largest vector I can allocate on a device (I'm still fairly new to boost::compute). The following snippet of code std::vector host_tmp; std::cout <<…
Brett Ryland
  • 1,045
  • 1
  • 9
  • 17
0
votes
1 answer

Pass a vector of custom structs by reference to a boost::compute closure or function

I'm somewhat new to opencl and am trying to learn to use boost::compute properly. Consider the following code: #include #include #include const cl_int cell_U_size{ 4 }; #pragma pack (push,1) struct Cell { …
Brett Ryland
  • 1,045
  • 1
  • 9
  • 17
0
votes
1 answer

boost compute (opencl wrapper), initial setup problems (qt, g++)

Been trying to compile this sample code: https://github.com/boostorg/compute/blob/master/README.md I installed QT Creator 5.7 using mingw530 I compiled the boost libraries using bootstrap.bat gcc b2 install --prefix="C:\Boostbuild"…
thistleknot
  • 1,098
  • 16
  • 38