hello_world.cpp 860 B

123456789101112131415161718192021222324252627282930
  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. //[hello_world_example
  11. #include <iostream>
  12. #include <boost/compute/core.hpp>
  13. namespace compute = boost::compute;
  14. int main()
  15. {
  16. // get the default device
  17. compute::device device = compute::system::default_device();
  18. // print the device's name and platform
  19. std::cout << "hello from " << device.name();
  20. std::cout << " (platform: " << device.platform().name() << ")" << std::endl;
  21. return 0;
  22. }
  23. //]