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