Commit Graph

120 Commits

Author SHA1 Message Date
Kyle Lutz
f235e59e82 Add inline_ptx example 2014-01-20 20:05:34 -08:00
Kyle Lutz
3be0ae78d8 Add batched_determinant example 2014-01-20 19:43:09 -08:00
Kyle Lutz
936d801466 Add support for host iterators to sort() 2014-01-13 18:27:52 -08:00
Kyle Lutz
aad03486d9 Add interop support
This adds interoperability support between Boost.Compute and various
other C/C++ libraries (Eigen, OpenCV, OpenGL, Qt and VTK). This eases
development for users using external libraries with Boost.Compute.
2014-01-06 23:35:38 -08:00
Kyle Lutz
0bc8818c50 Add Black-Scholes option pricing example 2014-01-06 22:52:48 -08:00
Kyle Lutz
eca81df028 Merge pull request #39 from ddemidov/offline-cache
Implements offline kernel caching
2014-01-06 22:47:52 -08:00
Denis Demidov
562f149b18 Implements offline kernel caching
See kylelutz/compute#21

This adds program::build_with_source() function that both creates and
builds the program for the given context with supplied source and
compile options. In case BOOST_COMPUTE_USE_OFFLINE_CACHE macro is
defined, it also saves the compiled program binary for reuse in the
offline cache located in $HOME/.boost_compute folder on UNIX-like
systems and in %APPDATA%/boost_compute folder on Windows.

All internal uses of program::create_with_source() followed by
program::build() are replaced with program::build_with_source().
2014-01-07 09:07:00 +04:00
Kyle Lutz
38c6e9bc0f Include only necessary headers in examples 2014-01-06 19:07:30 -08:00
Kyle Lutz
9f5ccb5ac6 Add price_cross example
This adds a new example demonstating the use of find_if() and
zip_iterator to find the point at which two vectors of price values
cross each other.
2014-01-03 14:34:47 -08:00
Kyle Lutz
52b1502f37 Rename find_longest_vector example to longest_vector 2014-01-03 14:09:47 -08:00
Kyle Lutz
4e94cab681 Improve the monte carlo example
This improves the monte carlo example by using the count_if()
algorithm instead of a custom kernel with atomics. Also includes
only the required headers instead of all the Boost.Compute headers.
2014-01-03 12:59:18 -08:00
Kyle Lutz
518d39fc2b Use bitwise-and to check device::type()
This changes the checks for the device type to use the bitwise-and
operator instead of the equaility operator. The returned type is a
bitset and this would cause errors when multiple bits were set.

This fixes a bug on POCL which returns the device type as a
combination of CL_DEVICE_TYPE_DEFAULT and CL_DEVICE_TYPE_CPU. Now
the correct device type (device::cpu) is detected for POCL.
2013-09-07 14:16:20 -04:00
Kyle Lutz
3bc5bfaf78 Remove timer class
This removes the timer class. The technique of measuring the time
difference between two different OpenCL markers on a command queue
is not portable to all OpenCL implementations (only works on NVIDIA).

A new internal timer class has been added which uses boost::chrono
(or std::chrono if BOOST_COMPUTE_TIMER_USE_STD_CHRONO is defined).
This new timer is used by the benchmarks to measure time elapsed
on the host.
2013-05-20 21:08:42 -04:00
Kyle Lutz
c70056491d Cleanup example code
This cleans up the example code. Now all of the examples use
the "namespace compute = boost::compute" alias. This shortens
the example code making it less verbose and more clear. Also
cleans up a few style issues.
2013-05-20 20:50:12 -04:00
Kyle Lutz
4ab37ada07 Add system-wide default command queue
This adds a system-wide default command queue. This queue is
accessible via the new static system::default_queue() method.
The default command queue is created for the default compute
device in the default context and is analogous to the default
stream in CUDA.

This changes how algorithms operate when invoked without an
explicit command queue. Previously, each algorithm had two
overloads, the first expected a command queue to be explicitly
passed and the second would create and use a temporary command
queue. Now, all algorithms take a command queue argument which
has a default value equal to system::default_queue().

This fixes a number of race-conditions and performance issues
througout the library associated with create, using, and
destroying many separate command queues.
2013-05-15 20:59:56 -04:00
Kyle Lutz
0b466fec72 Fix indexing bug in list_devices example
This fixes an indexing bug in the list_devices example in
which the information would only be printed for the first
device on a platform.
2013-05-11 20:11:58 -04:00
Kyle Lutz
178676df4f Refactor the system::default_device() method
This refactors the system::default_device() method. Now, the
default compute device for the system is only found once and
stored in a static variable. This eliminates many redundant
calls to clGetPlatformIDs() and clGetDeviceIDs().

Also, the default_cpu_device() and default_gpu_device() methods
have been removed and their usages replaced with default_device().
2013-05-10 22:49:05 -04:00
Dominic Meiser
2a93124ef5 Using FindOpenCL module from VexCL
Changed CMakeLists.txt files in Boost.Compute to use the variables
defined by FindOpenCL.
2013-04-23 20:03:38 -04:00
Denis Demidov
8b78d4187d Adds support for selecting devices with environment variables
boost::compute::system::default_device() supports the following
environment variables:

BOOST_COMPUTE_DEFAULT_DEVICE   for device name
BOOST_COMPUTE_DEFAULT_PLATFORM for OpenCL platform name
BOOST_COMPUTE_DEFAULT_VENDOR   for device vendor name

If one or more of these variables is set, then device that satisfies
all conditions gets selected. If such a device is unavailable, then
the first available GPU is selected. If there are no GPUs in the
system, then the first available CPU is selected. Otherwise,
default_device() returns null device.

The hello_world example is modified to use default_device() instead
of default_gpu_device().
2013-04-12 17:22:25 -04:00
Kyle Lutz
d34cdaac59 Initial commit 2013-03-02 15:14:17 -05:00