Commit Graph

25 Commits

Author SHA1 Message Date
Jakub Szuppe
6c2a3604b9 Implement vector::shrink_to_fit() 2017-06-17 17:44:26 +02:00
Janusz Rupar
da05ba9631 vector::reserve() implemented
Fixes bug #687
2017-05-14 11:32:33 +02:00
Jakub Szuppe
499689dd05 Fix test_vector.cpp
We have to sync buffer with queue.finish() before
reading it with another command queue.
2017-05-09 20:26:09 +02:00
Jakub Szuppe
f06aed04c6 Fix #484
Some tests should not be run if macro
BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST is defined.
2017-04-08 18:19:43 +02:00
Jakub Szuppe
4c21633bf9 Fix vector copy ctor when using non-default context
Now correct queue (from correct context) is used in copy
constructor of boost::compute::vector.
2016-07-17 00:01:47 +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
Thomas Trummer
68d373c38a Add missing include for std::cerr (on macOS) 2016-07-10 18:38:23 +02:00
Jakub Szuppe
57ea7d85df Skipping resize_throw_exception test on Apple
From tests on Travis-CI it seems that on Apple OpenCL platform
clCreatBuffer() does not return NULL and does not set error to
CL_INVALID_BUFFER_SIZE when size of the buffer memory object is
greater than CL_DEVICE_MAX_MEM_ALLOC_SIZE.
2016-05-05 14:23:28 +02:00
Jakub Szuppe
6396530a2b Fix comparison between signed and unsigned integer 2016-01-07 20:54:54 +01:00
Jakub Szuppe
5e2598bfdd Add more test for vector with custom allocator 2015-10-05 14:28:37 +02:00
Jakub Szuppe
01af4136da Add test for vector move ctor when custom allocator is used 2015-10-05 14:28:32 +02:00
Jakub Szuppe
7894d1f7c0 Add missing queue and context parameters in tests 2015-07-02 22:20:42 +02:00
Kyle Lutz
fda67a22d0 Update GitHub links 2015-05-17 20:32:09 -07:00
Kyle Lutz
8b27e22b2f Add test for vector::resize() exception-safety 2015-01-07 20:17:26 -08:00
Kyle Lutz
417cb03670 Fixes for Mac OS X 2014-12-24 09:25:55 -08:00
Kyle Lutz
4a1b3edf48 Fix resize bug with vector::assign()
This fixes a bug in which vector::assign() would not resize
itself to accommodate the assigned values. Now the behavior
matches that of std::vector.
2014-07-07 21:56:39 -07:00
Kyle Lutz
a639e408b8 Cleanup move-semantics for all core types 2014-06-08 13:40:27 -07:00
Kyle Lutz
2ca2c16839 Swap allocators in vector::swap() 2014-06-06 08:29: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
844690070f Remove STL algorithm tests from vector<> test
This removes the STL algorithm tests from the vector<> test.
2013-11-15 19:41:12 -08: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
1b9e904cc7 Add CHECK_RANGE_EQUAL() test macro
This adds a new macro for the unit-tests which checks a range of
values on the device against an array of values on the host. This
simplifies writing tests and removes the need to explicitly copy
values back to the host for verification.
2013-05-13 23:06:40 -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