test_system.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013 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 TestSystem
  11. #include <boost/test/unit_test.hpp>
  12. #include <boost/compute/device.hpp>
  13. #include <boost/compute/system.hpp>
  14. BOOST_AUTO_TEST_CASE(platform_count)
  15. {
  16. BOOST_CHECK(boost::compute::system::platform_count() >= 1);
  17. }
  18. BOOST_AUTO_TEST_CASE(device_count)
  19. {
  20. BOOST_CHECK(boost::compute::system::device_count() >= 1);
  21. }
  22. BOOST_AUTO_TEST_CASE(default_device)
  23. {
  24. boost::compute::device device = boost::compute::system::default_device();
  25. BOOST_CHECK(device.id() != cl_device_id());
  26. }
  27. BOOST_AUTO_TEST_CASE(find_device)
  28. {
  29. boost::compute::device device = boost::compute::system::default_device();
  30. const std::string &name = device.name();
  31. BOOST_CHECK(boost::compute::system::find_device(name).name() == device.name());
  32. }