Move HardwareInfo ownership to ExecutionEnvironment [1/n]

Change-Id: I5e5b4cc45947a8841282c7d431fb69d9c397a2d4
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-05-06 12:33:44 +02:00
committed by sys_ocldev
parent b2aee82f41
commit bb80d327c7
233 changed files with 1786 additions and 2298 deletions

View File

@ -190,7 +190,7 @@ TEST_F(clBuildProgramTests, GivenSpirAsInputWhenCreatingProgramFromBinaryThenPro
SProgramBinaryHeader progBin = {};
progBin.Magic = iOpenCL::MAGIC_CL;
progBin.Version = iOpenCL::CURRENT_ICBE_VERSION;
progBin.Device = pContext->getDevice(0)->getHardwareInfo().pPlatform->eRenderCoreFamily;
progBin.Device = pContext->getDevice(0)->getHardwareInfo().pPlatform.eRenderCoreFamily;
igcDebugVars.binaryToReturn = &progBin;
igcDebugVars.binaryToReturnSize = sizeof(progBin);
auto prevDebugVars = getIgcDebugVars();

View File

@ -49,14 +49,13 @@ TEST_F(clSetPerformanceConfigurationINTELTests, negativeInstrumentationDisabled)
cl_uint offsets[2];
cl_uint values[2];
HardwareInfo *pInHwInfo = const_cast<HardwareInfo *>(hwInfo);
bool instrumentationEnabled = pInHwInfo->capabilityTable.instrumentationEnabled;
pInHwInfo->capabilityTable.instrumentationEnabled = false;
bool instrumentationEnabled = hwInfo->capabilityTable.instrumentationEnabled;
hwInfo->capabilityTable.instrumentationEnabled = false;
ret = clSetPerformanceConfigurationINTEL(device.get(), 2, offsets, values);
EXPECT_EQ(CL_PROFILING_INFO_NOT_AVAILABLE, ret);
pInHwInfo->capabilityTable.instrumentationEnabled = instrumentationEnabled;
hwInfo->capabilityTable.instrumentationEnabled = instrumentationEnabled;
}
} // namespace ULT

View File

@ -85,24 +85,7 @@ INSTANTIATE_TEST_CASE_P(
clSVMAllocValidFlagsTests,
testing::ValuesIn(SVMAllocValidFlags));
struct clSVMAllocFtrFlagsTests : public clSVMAllocTemplateTests {
public:
void SetUp() override {
clSVMAllocTemplateTests::SetUp();
const HardwareInfo &hwInfo = pPlatform->getDevice(0)->getHardwareInfo();
oldFtrSvm = hwInfo.capabilityTable.ftrSvm;
oldFtrCoherency = hwInfo.capabilityTable.ftrSupportsCoherency;
}
void TearDown() override {
const HardwareInfo &hwInfo = pPlatform->getDevice(0)->getHardwareInfo();
HardwareInfo *pHwInfo = const_cast<HardwareInfo *>(&hwInfo);
pHwInfo->capabilityTable.ftrSvm = oldFtrSvm;
pHwInfo->capabilityTable.ftrSupportsCoherency = oldFtrCoherency;
clSVMAllocTemplateTests::TearDown();
}
bool oldFtrSvm;
bool oldFtrCoherency;
};
using clSVMAllocFtrFlagsTests = clSVMAllocTemplateTests;
INSTANTIATE_TEST_CASE_P(
SVMAllocCheckFlagsFtrFlags,
@ -110,8 +93,7 @@ INSTANTIATE_TEST_CASE_P(
testing::ValuesIn(SVMAllocValidFlags));
TEST_P(clSVMAllocFtrFlagsTests, SVMAllocValidFlags) {
const HardwareInfo &hwInfo = pPlatform->getDevice(0)->getHardwareInfo();
HardwareInfo *pHwInfo = const_cast<HardwareInfo *>(&hwInfo);
HardwareInfo *pHwInfo = pPlatform->peekExecutionEnvironment()->getMutableHardwareInfo();
cl_mem_flags flags = GetParam();
void *SVMPtr = nullptr;