Commit Graph

15 Commits

Author SHA1 Message Date
Jakub Szuppe
6e6bcf6bc8 Add buffer memory leak test case
See issue #746
2018-05-12 12:29:44 +02:00
Jakub Szuppe
2af23fa7e9 Change various tests to work with non-default context
Now all tests work even if Context::context, Context::device,
Context::queue are not default context, device and queue. This
is required for developing better tests in the future.

Note: Some tests may work only for default context/queue/device
since classes that they test work only for default context/q/d.
There are two solutions for this problem: either those tests run
on default queue (no matter what) or they does not run when
Context::context is not the default context. See test_string.cpp.
2016-07-16 20:30:28 +02:00
Kyle Lutz
0b3d80c35a Add test for reduce() with uchar to float 2016-04-29 20:06:52 -07:00
Kyle Lutz
fda67a22d0 Update GitHub links 2015-05-17 20:32:09 -07:00
Kyle Lutz
891aff215d Fix bug when calling reduce() with empty ranges 2014-09-04 20:42:37 -07:00
Kyle Lutz
9343b99085 Improve documentation 2014-04-24 19:51:45 -07:00
Kyle Lutz
ccd6f21d98 Change vector constructors to take queue argument
This changes the vector<T> constructors which copy or initialize
data to take a queue argument used for performing the operations.

Previously they just took a context argument used to initialize the
buffer and then created a new command queue to use. This improves
performance by not requiring a new command queue and also fixes issues
when performing operations on a different command queue while the
vector was still being initialized.
2014-01-27 23:39:19 -08:00
Kyle Lutz
1dd35de225 Fix sign comparison warnings in tests 2014-01-14 21:29:25 -08:00
Kyle Lutz
ac1ff45eff Add reduce_on_gpu() algorithm
This adds a improved reduce() algorithm implementation for
GPUs. Also adds checks to accumulate() which allow it to
use the higher-performance reduce() algorithm if possible.
2013-12-21 10:56:55 -08:00
Kyle Lutz
6b6f66b6ba Add reduce() overload without function argument
This adds adds an overload of the reduce() function which
uses plus<T>() as the reductor. This simplifies the common
case of calculating the sum for a range of values.
2013-12-07 15:02:04 -08:00
Kyle Lutz
ba9e64e316 Remove init argument from reduce()
This removes the init argument from reduce. This simplifies the
implementation and avoids copying a value from the host to the
device on every call to reduce.

If an initial value is required, the accumulate function can be
called instead.
2013-12-07 14:49:46 -08:00
Kyle Lutz
736f3a17a6 Add min_and_max reduce() test
This adds a test for computing the minimum and maximum
values of a vector simultaneously using reduce() with a
custom reduction function.

Also fixes a bug in reduce() in which inplace_reduce() was
being used even if the input type and result type differed.
2013-09-24 22:47:16 -04:00
Kyle Lutz
a96c9c0182 Add result argument to reduce() algorithm
This adds an output iterator result argument to the reduce()
algorithm. Now, instead of returning the reduced result, the
result is written to an output iterator. This allows the value
to stay on the device and avoids a device-to-host copy in cases
where the result is not needed on the host (e.g. it is part of
a larger computation).

This is an API breaking change to users of reduce(). Affected code
should now declare a result variable and then pass a pointer to it
as the new result argument.
2013-09-07 15:36:49 -04:00
Denis Demidov
5d77bbebee Global setup for OpenCL context in tests
refs kylelutz/compute#9

device, context, and queue are initialized statically in `context_setup.hpp`.
With this change all tests are able to complete when an NVIDIA GPU is in
exclusive compute mode.

Side effect of the change:
Time for all tests to complete reduced from 15.71 to 13.03 sec Tesla C2075.
2013-04-19 14:53:59 +04:00
Kyle Lutz
d34cdaac59 Initial commit 2013-03-02 15:14:17 -05:00