Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:11:13

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2020 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 // System include(s)
0010 #include <iostream>
0011 
0012 // SYCL plugin include(s)
0013 #include "Acts/Plugins/Sycl/Utilities/ListPlatforms.hpp"
0014 
0015 // SYCL include
0016 #include <CL/sycl.hpp>
0017 
0018 namespace Acts::Sycl {
0019 /// @brief This function allows us to list available SYCL platforms and devices.
0020 void listPlatforms() {
0021   for (const sycl::platform& platform : sycl::platform::get_platforms()) {
0022     // Print some information about the platform.
0023     std::cout << "============ Platform ============" << std::endl;
0024     std::cout << " Name   : " << platform.get_info<sycl::info::platform::name>()
0025               << std::endl;
0026     std::cout << " Vendor : "
0027               << platform.get_info<sycl::info::platform::vendor>() << std::endl;
0028     std::cout << " Version: "
0029               << platform.get_info<sycl::info::platform::version>()
0030               << std::endl;
0031 
0032     // Loop over all devices available from this platform.
0033     for (const sycl::device& device : platform.get_devices()) {
0034       // Print some information about the device.
0035       std::cout << "------------- Device -------------" << std::endl;
0036       std::cout << " Name   : " << device.get_info<sycl::info::device::name>()
0037                 << std::endl;
0038       std::cout << " Vendor : " << device.get_info<sycl::info::device::vendor>()
0039                 << std::endl;
0040       std::cout << " Version: "
0041                 << device.get_info<sycl::info::device::version>() << std::endl;
0042     }
0043   }
0044 }
0045 }  // namespace Acts::Sycl