2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2019-03-19 15:09:33 +01:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2018-08-07 14:46:15 +02:00
|
|
|
class ExecutionEnvironment;
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
class DeviceFactory {
|
|
|
|
|
public:
|
2019-05-06 12:33:44 +02:00
|
|
|
static bool getDevices(size_t &numDevices, ExecutionEnvironment &executionEnvironment);
|
|
|
|
|
static bool getDevicesForProductFamilyOverride(size_t &numDevices, ExecutionEnvironment &executionEnvironment);
|
2017-12-21 00:45:38 +01:00
|
|
|
static void releaseDevices();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
static size_t numDevices;
|
|
|
|
|
};
|
2018-07-12 11:45:02 +02:00
|
|
|
|
|
|
|
|
class DeviceFactoryCleaner {
|
|
|
|
|
public:
|
|
|
|
|
~DeviceFactoryCleaner() { DeviceFactory::releaseDevices(); }
|
|
|
|
|
};
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|