EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ListPlatforms.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ListPlatforms.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 // System include(s)
10 #include <iostream>
11 
12 // SYCL plugin include(s)
14 
15 // SYCL include
16 #include <CL/sycl.hpp>
17 
18 namespace Acts::Sycl {
20 void listPlatforms() {
21  for (const sycl::platform& platform : sycl::platform::get_platforms()) {
22  // Print some information about the platform.
23  std::cout << "============ Platform ============" << std::endl;
24  std::cout << " Name : " << platform.get_info<sycl::info::platform::name>()
25  << std::endl;
26  std::cout << " Vendor : "
27  << platform.get_info<sycl::info::platform::vendor>() << std::endl;
28  std::cout << " Version: "
29  << platform.get_info<sycl::info::platform::version>()
30  << std::endl;
31 
32  // Loop over all devices available from this platform.
33  for (const sycl::device& device : platform.get_devices()) {
34  // Print some information about the device.
35  std::cout << "------------- Device -------------" << std::endl;
36  std::cout << " Name : " << device.get_info<sycl::info::device::name>()
37  << std::endl;
38  std::cout << " Vendor : " << device.get_info<sycl::info::device::vendor>()
39  << std::endl;
40  std::cout << " Version: "
41  << device.get_info<sycl::info::device::version>() << std::endl;
42  }
43  }
44 }
45 } // namespace Acts::Sycl