mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Rename wrapReleasableObjectWithUniquePtr to clUniquePtr
Change-Id: I67a3ff2d30d8f8485394bd2744de0924205f092e Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
666d8854f8
commit
2e5e785092
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2017-2018 Intel Corporation
|
* Copyright (C) 2017-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -444,7 +444,7 @@ HWTEST_F(BuiltInTests, givenKernelWithAuxTranslationRequiredWhenEnqueueCalledThe
|
|||||||
auto mockAuxBuiltInOp = new MockAuxBuilInOp<FamilyType>(*pBuiltIns, *pContext, *pDevice);
|
auto mockAuxBuiltInOp = new MockAuxBuilInOp<FamilyType>(*pBuiltIns, *pContext, *pDevice);
|
||||||
pBuiltIns->BuiltinOpsBuilders[static_cast<uint32_t>(EBuiltInOps::AuxTranslation)].first.reset(mockAuxBuiltInOp);
|
pBuiltIns->BuiltinOpsBuilders[static_cast<uint32_t>(EBuiltInOps::AuxTranslation)].first.reset(mockAuxBuiltInOp);
|
||||||
|
|
||||||
auto mockProgram = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
auto mockProgram = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||||
auto mockBuiltinKernel = MockKernel::create(*pDevice, mockProgram.get());
|
auto mockBuiltinKernel = MockKernel::create(*pDevice, mockProgram.get());
|
||||||
mockAuxBuiltInOp->usedKernels.at(0).reset(mockBuiltinKernel);
|
mockAuxBuiltInOp->usedKernels.at(0).reset(mockBuiltinKernel);
|
||||||
|
|
||||||
|
|||||||
@@ -2842,20 +2842,20 @@ TEST_F(ProgramTests, givenCompilerInterfaceWhenCompileIsCalledThenProperIntermed
|
|||||||
pDevice->getExecutionEnvironment()->compilerInterface.reset(compilerInterface);
|
pDevice->getExecutionEnvironment()->compilerInterface.reset(compilerInterface);
|
||||||
|
|
||||||
compilerInterface->useLlvmText = true;
|
compilerInterface->useLlvmText = true;
|
||||||
auto programLlvmText = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
auto programLlvmText = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||||
programLlvmText->setDevice(device);
|
programLlvmText->setDevice(device);
|
||||||
compilerInterface->intermediateRepresentation = IGC::CodeType::spirV;
|
compilerInterface->intermediateRepresentation = IGC::CodeType::spirV;
|
||||||
compilerInterface->compile(*programLlvmText, input);
|
compilerInterface->compile(*programLlvmText, input);
|
||||||
EXPECT_FALSE(programLlvmText->getIsSpirV());
|
EXPECT_FALSE(programLlvmText->getIsSpirV());
|
||||||
|
|
||||||
compilerInterface->useLlvmText = false;
|
compilerInterface->useLlvmText = false;
|
||||||
auto programSpirV = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
auto programSpirV = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||||
programSpirV->setDevice(device);
|
programSpirV->setDevice(device);
|
||||||
compilerInterface->intermediateRepresentation = IGC::CodeType::spirV;
|
compilerInterface->intermediateRepresentation = IGC::CodeType::spirV;
|
||||||
compilerInterface->compile(*programSpirV, input);
|
compilerInterface->compile(*programSpirV, input);
|
||||||
EXPECT_TRUE(programSpirV->getIsSpirV());
|
EXPECT_TRUE(programSpirV->getIsSpirV());
|
||||||
|
|
||||||
auto programLlvmBc = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
auto programLlvmBc = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||||
programLlvmBc->setDevice(device);
|
programLlvmBc->setDevice(device);
|
||||||
compilerInterface->intermediateRepresentation = IGC::CodeType::llvmBc;
|
compilerInterface->intermediateRepresentation = IGC::CodeType::llvmBc;
|
||||||
compilerInterface->compile(*programLlvmBc, input);
|
compilerInterface->compile(*programLlvmBc, input);
|
||||||
@@ -2881,7 +2881,7 @@ TEST_F(ProgramTests, givenProgramWithSpirvWhenRebuildProgramIsCalledThenSpirvPat
|
|||||||
gEnvironment->igcPushDebugVars(debugVars);
|
gEnvironment->igcPushDebugVars(debugVars);
|
||||||
std::unique_ptr<void, void (*)(void *)> igcDebugVarsAutoPop{&gEnvironment, [](void *) { gEnvironment->igcPopDebugVars(); }};
|
std::unique_ptr<void, void (*)(void *)> igcDebugVarsAutoPop{&gEnvironment, [](void *) { gEnvironment->igcPopDebugVars(); }};
|
||||||
|
|
||||||
auto program = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
auto program = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||||
program->setDevice(device);
|
program->setDevice(device);
|
||||||
uint32_t spirv[16] = {0x03022307, 0x23471113, 0x17192329};
|
uint32_t spirv[16] = {0x03022307, 0x23471113, 0x17192329};
|
||||||
program->storeIrBinary(spirv, sizeof(spirv), true);
|
program->storeIrBinary(spirv, sizeof(spirv), true);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 Intel Corporation
|
* Copyright (C) 2018-2019 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -14,7 +14,7 @@ template <typename T>
|
|||||||
using ReleaseableObjectPtr = std::unique_ptr<T, void (*)(T *)>;
|
using ReleaseableObjectPtr = std::unique_ptr<T, void (*)(T *)>;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static ReleaseableObjectPtr<T> wrapReleasableObjectWithUniquePtr(T *object) {
|
static ReleaseableObjectPtr<T> clUniquePtr(T *object) {
|
||||||
return ReleaseableObjectPtr<T>{object, [](T *p) { p->release(); }};
|
return ReleaseableObjectPtr<T>{object, [](T *p) { p->release(); }};
|
||||||
}
|
}
|
||||||
} // namespace OCLRT
|
} // namespace OCLRT
|
||||||
|
|||||||
Reference in New Issue
Block a user