mirror of
https://github.com/intel/compute-runtime.git
synced 2025-06-28 17:58:30 +08:00

Change-Id: I2c78a8b737ee8e61b917b4918da37e77bbd9fe34 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
32 lines
697 B
C++
32 lines
697 B
C++
/*
|
|
* Copyright (C) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "core/helpers/hw_helper.h"
|
|
|
|
namespace NEO {
|
|
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
|
|
|
|
template <class MockHelper>
|
|
class RAIIHwHelperFactory {
|
|
public:
|
|
GFXCORE_FAMILY gfxCoreFamily;
|
|
HwHelper *hwHelper;
|
|
MockHelper mockHwHelper;
|
|
|
|
RAIIHwHelperFactory(GFXCORE_FAMILY gfxCoreFamily) {
|
|
this->gfxCoreFamily = gfxCoreFamily;
|
|
hwHelper = hwHelperFactory[this->gfxCoreFamily];
|
|
hwHelperFactory[this->gfxCoreFamily] = &mockHwHelper;
|
|
}
|
|
|
|
~RAIIHwHelperFactory() {
|
|
hwHelperFactory[this->gfxCoreFamily] = hwHelper;
|
|
}
|
|
};
|
|
} // namespace NEO
|