mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 19:32:25 +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
|
||||
*
|
||||
@@ -444,7 +444,7 @@ HWTEST_F(BuiltInTests, givenKernelWithAuxTranslationRequiredWhenEnqueueCalledThe
|
||||
auto mockAuxBuiltInOp = new MockAuxBuilInOp<FamilyType>(*pBuiltIns, *pContext, *pDevice);
|
||||
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());
|
||||
mockAuxBuiltInOp->usedKernels.at(0).reset(mockBuiltinKernel);
|
||||
|
||||
|
||||
@@ -2842,20 +2842,20 @@ TEST_F(ProgramTests, givenCompilerInterfaceWhenCompileIsCalledThenProperIntermed
|
||||
pDevice->getExecutionEnvironment()->compilerInterface.reset(compilerInterface);
|
||||
|
||||
compilerInterface->useLlvmText = true;
|
||||
auto programLlvmText = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||
auto programLlvmText = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||
programLlvmText->setDevice(device);
|
||||
compilerInterface->intermediateRepresentation = IGC::CodeType::spirV;
|
||||
compilerInterface->compile(*programLlvmText, input);
|
||||
EXPECT_FALSE(programLlvmText->getIsSpirV());
|
||||
|
||||
compilerInterface->useLlvmText = false;
|
||||
auto programSpirV = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||
auto programSpirV = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||
programSpirV->setDevice(device);
|
||||
compilerInterface->intermediateRepresentation = IGC::CodeType::spirV;
|
||||
compilerInterface->compile(*programSpirV, input);
|
||||
EXPECT_TRUE(programSpirV->getIsSpirV());
|
||||
|
||||
auto programLlvmBc = wrapReleasableObjectWithUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||
auto programLlvmBc = clUniquePtr(new MockProgram(*pDevice->getExecutionEnvironment()));
|
||||
programLlvmBc->setDevice(device);
|
||||
compilerInterface->intermediateRepresentation = IGC::CodeType::llvmBc;
|
||||
compilerInterface->compile(*programLlvmBc, input);
|
||||
@@ -2881,7 +2881,7 @@ TEST_F(ProgramTests, givenProgramWithSpirvWhenRebuildProgramIsCalledThenSpirvPat
|
||||
gEnvironment->igcPushDebugVars(debugVars);
|
||||
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);
|
||||
uint32_t spirv[16] = {0x03022307, 0x23471113, 0x17192329};
|
||||
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
|
||||
*
|
||||
@@ -14,7 +14,7 @@ template <typename T>
|
||||
using ReleaseableObjectPtr = std::unique_ptr<T, void (*)(T *)>;
|
||||
|
||||
template <typename T>
|
||||
static ReleaseableObjectPtr<T> wrapReleasableObjectWithUniquePtr(T *object) {
|
||||
static ReleaseableObjectPtr<T> clUniquePtr(T *object) {
|
||||
return ReleaseableObjectPtr<T>{object, [](T *p) { p->release(); }};
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
Reference in New Issue
Block a user