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