test_buffer_allocator.cpp 906 B

1234567891011121314151617181920212223242526272829
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. // See http://boostorg.github.com/compute for more information.
  9. //---------------------------------------------------------------------------//
  10. #define BOOST_TEST_MODULE TestBufferAllocator
  11. #include <boost/test/unit_test.hpp>
  12. #include <boost/compute/allocator/buffer_allocator.hpp>
  13. #include "context_setup.hpp"
  14. namespace compute = boost::compute;
  15. BOOST_AUTO_TEST_CASE(allocate)
  16. {
  17. compute::buffer_allocator<int> allocator(context);
  18. typedef compute::buffer_allocator<int>::pointer pointer;
  19. pointer x = allocator.allocate(10);
  20. allocator.deallocate(x, 10);
  21. }
  22. BOOST_AUTO_TEST_SUITE_END()