// Copyright 2009-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 #include "../../../kernels/level_zero/ze_wrapper.h" namespace embree { inline void printDeviceInfo(sycl::device const& device) { std::cout << " SYCL Device:\n"; std::cout << " Name: " << device.get_info() << "\n"; std::cout << " Platform: " << device.get_platform().get_info() << "\n"; if (device.is_gpu()) { std::cout << " Type: GPU\n"; std::cout << " Max Work Group Size : " << device.get_info() << "\n"; std::cout << " Max Compute Units : " << device.get_info() << std::endl; } else { std::cout << " Type: CPU" << std::endl; } /* list extensions */ bool ze_extension_ray_tracing = false; bool ze_rtas_builder = false; sycl::platform platform = device.get_platform(); ze_driver_handle_t hDriver = sycl::get_native(platform); uint32_t count = 0; std::vector extensions; ze_result_t result = ZeWrapper::zeDriverGetExtensionProperties(hDriver,&count,extensions.data()); if (result == ZE_RESULT_SUCCESS) { extensions.resize(count); result = ZeWrapper::zeDriverGetExtensionProperties(hDriver,&count,extensions.data()); if (result == ZE_RESULT_SUCCESS) { for (uint32_t i=0; i compatible_devices; std::vector incompatible_devices; std::vector platforms = sycl::platform::get_platforms(); for (auto &platform : platforms) { std::vector devices = platform.get_devices(); for (auto &device : devices) { if (rtcIsSYCLDeviceSupported(device)) compatible_devices.push_back(device); else incompatible_devices.push_back(device); } } if (compatible_devices.empty() && incompatible_devices.empty()) { std::cout << "No SYCL device found." << std::endl; std::cout << std::endl; return; } if (compatible_devices.empty()) { std::cout << "No Embree compatible SYCL GPU device found." << std::endl; std::cout << std::endl; } else { std::cout << "Embree compatible SYCL " << (compatible_devices.size() > 1 ? "devices:" : "device") << std::endl; for (auto & device : compatible_devices) printDeviceInfo(device); std::cout << std::endl; } if (!incompatible_devices.empty() ) { std::cout << "Embree incompatible SYCL " << (incompatible_devices.size() > 1 ? "devices:" : "device") << std::endl; for (auto & device : incompatible_devices) printDeviceInfo(device); std::cout << std::endl; } } }