message: Enable multi-GPU support in sgemm example
  sgemm example uses directly L0 API.
  This commit enables the user to configure
  which GPU device number to use (using ISPC_GPU_DEVICE
  or ISPCRT_GPU_DEVICE environmental variables).
  The mechanism counts only Intel GPUs. The first device
  has number 0 (which is default if no env variable
  is set)
diff: #include <cassert>
  #include <fstream>
  +#include <vector>
  +#include <sstream>
  #include <level_zero/ze_api.h>
  #include <level_zero/zes_api.h>
  @@ -56,15 +58,52 @@ void L0InitContext(ze_driver_handle_t &hDriver, ze_device_handle_t &hDevice, ze_
  bool use_zebin) {
  L0_SAFE_CALL(zeInit(ZE_INIT_FLAG_GPU_ONLY));
  - // Retrieve driver
  + // Retrieve drivers
  uint32_t driverCount = 0;
  L0_SAFE_CALL(zeDriverGet(&driverCount, nullptr));
  - L0_SAFE_CALL(zeDriverGet(&driverCount, &hDriver));
  + assert(driverCount != 0);
  +
  + std::vector<ze_driver_handle_t> allDrivers(driverCount);
  + L0_SAFE_CALL(zeDriverGet(&driverCount, allDrivers.data()));
  +
  + // Find an instance of Intel GPU device
  + // User can select particular device using env variable
  + // By default first available device is selected
  + auto gpuDeviceToGrab = 0;
  + const char *gpuDeviceEnv = getenv("ISPC_GPU_DEVICE");
  + if (gpuDeviceEnv) {
  + std::istringstream(gpuDeviceEnv) >> gpuDeviceToGrab;
  + } else {
  + // Allow using ISPCRT env to make things easier
  + const char *gpuDeviceEnv = getenv("ISPCRT_GPU_DEVICE");
  + if (gpuDeviceEnv) {
  + std::istringstream(gpuDeviceEnv) >> gpuDeviceToGrab;
  + }
  + }
  - // Retrieve device
  + auto gpuDevice = 0;
  + for (auto &driver : allDrivers) {
  uint32_t deviceCount = 0;
  - L0_SAFE_CALL(zeDeviceGet(hDriver, &deviceCount, nullptr));
  - L0_SAFE_CALL(zeDeviceGet(hDriver, &deviceCount, &hDevice));
  + L0_SAFE_CALL(zeDeviceGet(driver, &deviceCount, nullptr));
  + std::vector<ze_device_handle_t> allDevices(deviceCount);
  + L0_SAFE_CALL(zeDeviceGet(driver, &deviceCount, allDevices.data()));
  +
  + for (auto &device : allDevices) {
  + ze_device_properties_t device_properties;
  + L0_SAFE_CALL(zeDeviceGetProperties(device, &device_properties));
  + if (device_properties.type == ZE_DEVICE_TYPE_GPU && device_properties.vendorId == 0x8086) {
  + gpuDevice++;
  + if (gpuDevice == gpuDeviceToGrab + 1) {
  + hDevice = device;
  + hDriver = driver;
  + break;
  + }
  + }
  + }
  +
  + if (hDevice)
  + break;
  + }
  assert(hDriver);
  assert(hDevice);
  