mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
refactor: apply clang-format's InsertBraces rule
Formats code before InsertBraces rule is enabled. Signed-off-by: Radoslaw Jablonski <radoslaw.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9d1da44e08
commit
54de14a9dc
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -242,103 +242,123 @@ template <class T>
|
||||
size_t CmdParse<T>::getCommandLength(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_BASE_ADDRESS *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<PIPE_CONTROL *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_ARB_CHECK *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_ATOMIC *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return sizeof(MI_ATOMIC) / sizeof(uint32_t);
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_BATCH_BUFFER_END *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_BATCH_BUFFER_START *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_LOAD_REGISTER_MEM *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_STORE_REGISTER_MEM *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_NOOP *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<PIPELINE_SELECT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_REPORT_PERF_COUNT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_MATH *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->DW0.BitField.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_LOAD_REGISTER_REG *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_SEMAPHORE_WAIT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_STORE_DATA_IMM *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_FLUSH_DW *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<XY_COPY_BLT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<XY_COLOR_BLT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_USER_INTERRUPT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return sizeof(MI_USER_INTERRUPT) / sizeof(uint32_t);
|
||||
}
|
||||
}
|
||||
|
||||
auto commandLengthHwSpecific = getCommandLengthHwSpecific(cmd);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -19,43 +19,51 @@ template <>
|
||||
size_t CmdParse<GenGfxFamily>::getCommandLengthHwSpecific(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_COMPUTE_MODE *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<COMPUTE_WALKER *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<CFE_STATE *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<_3DSTATE_BINDING_TABLE_POOL_ALLOC *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_SET_PREDICATE *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<_3DSTATE_BTD *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_SIP *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<XY_BLOCK_COPY_BLT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -19,28 +19,33 @@ template <>
|
||||
size_t CmdParse<GenGfxFamily>::getCommandLengthHwSpecific(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_COMPUTE_MODE *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_SET_PREDICATE *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<_3DSTATE_BTD *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_SIP *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<XY_BLOCK_COPY_BLT *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -21,8 +21,9 @@ template <typename Type>
|
||||
static inline GenCmdList::iterator find(GenCmdList::iterator itorStart, GenCmdList::const_iterator itorEnd) {
|
||||
GenCmdList::iterator itor = itorStart;
|
||||
while (itor != itorEnd) {
|
||||
if (genCmdCast<Type>(*itor))
|
||||
if (genCmdCast<Type>(*itor)) {
|
||||
break;
|
||||
}
|
||||
++itor;
|
||||
}
|
||||
return itor;
|
||||
@@ -46,8 +47,9 @@ static inline GenCmdList::iterator findMmio(GenCmdList::iterator itorStart, GenC
|
||||
GenCmdList::iterator itor = itorStart;
|
||||
while (itor != itorEnd) {
|
||||
auto cmd = genCmdCast<typename FamilyType::MI_LOAD_REGISTER_IMM *>(*itor);
|
||||
if (cmd && cmd->getRegisterOffset() == regOffset)
|
||||
if (cmd && cmd->getRegisterOffset() == regOffset) {
|
||||
break;
|
||||
}
|
||||
++itor;
|
||||
}
|
||||
return itor;
|
||||
@@ -80,8 +82,9 @@ template <typename Type>
|
||||
static inline GenCmdList::reverse_iterator reverseFind(GenCmdList::reverse_iterator itorStart, GenCmdList::const_reverse_iterator itorEnd) {
|
||||
GenCmdList::reverse_iterator itor = itorStart;
|
||||
while (itor != itorEnd) {
|
||||
if (genCmdCast<Type>(*itor))
|
||||
if (genCmdCast<Type>(*itor)) {
|
||||
break;
|
||||
}
|
||||
++itor;
|
||||
}
|
||||
return itor;
|
||||
|
||||
@@ -93,8 +93,9 @@ std::string getRunPath(char *argv0) {
|
||||
std::string res(argv0);
|
||||
|
||||
auto pos = res.rfind(fSeparator);
|
||||
if (pos != std::string::npos)
|
||||
if (pos != std::string::npos) {
|
||||
res = res.substr(0, pos);
|
||||
}
|
||||
|
||||
if (res == "." || pos == std::string::npos) {
|
||||
char *cwd;
|
||||
@@ -245,8 +246,9 @@ int main(int argc, char **argv) {
|
||||
bool selectAllProducts = (strcmp("*", argv[i]) == 0);
|
||||
productFamily = IGFX_UNKNOWN;
|
||||
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
|
||||
if (hardwarePrefix[j] == nullptr)
|
||||
if (hardwarePrefix[j] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if ((strcmp(hardwarePrefix[j], argv[i]) == 0) || selectAllProducts) {
|
||||
productFamily = static_cast<PRODUCT_FAMILY>(j);
|
||||
selectedTestProducts.push_back(productFamily);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -54,12 +54,14 @@ struct MockElfBinaryPatchtokens {
|
||||
enc.getElfFileHeader().identity = Elf::ElfFileHeaderIdentity(Elf::EI_CLASS_64);
|
||||
enc.getElfFileHeader().type = NEO::Elf::ET_OPENCL_EXECUTABLE;
|
||||
enc.appendSection(Elf::SHT_OPENCL_DEV_BINARY, Elf::SectionNamesOpenCl::deviceBinary, ArrayRef<const uint8_t>::fromAny(mockDevBinaryData, mockDevBinaryDataSize));
|
||||
if (irFormat == EnabledIrFormat::spirv)
|
||||
if (irFormat == EnabledIrFormat::spirv) {
|
||||
enc.appendSection(Elf::SHT_OPENCL_SPIRV, Elf::SectionNamesOpenCl::spirvObject, ArrayRef<const uint8_t>::fromAny(mockSpirvBinaryData, mockSpirvBinaryDataSize));
|
||||
else if (irFormat == EnabledIrFormat::llvm)
|
||||
} else if (irFormat == EnabledIrFormat::llvm) {
|
||||
enc.appendSection(Elf::SHT_OPENCL_LLVM_BINARY, Elf::SectionNamesOpenCl::llvmObject, ArrayRef<const uint8_t>::fromAny(mockLlvmBinaryData, mockLlvmBinaryDataSize));
|
||||
if (false == buildOptions.empty())
|
||||
}
|
||||
if (false == buildOptions.empty()) {
|
||||
enc.appendSection(Elf::SHT_OPENCL_OPTIONS, Elf::SectionNamesOpenCl::buildOptions, ArrayRef<const uint8_t>::fromAny(buildOptions.data(), buildOptions.size()));
|
||||
}
|
||||
storage = enc.encode();
|
||||
}
|
||||
static constexpr size_t mockDataSize = 0x10;
|
||||
|
||||
@@ -25,12 +25,14 @@ size_t getAdditionalCommandLengthHwSpecific(void *cmd) {
|
||||
using L3_CONTROL_WITHOUT_POST_SYNC = typename GenGfxFamily::L3_CONTROL;
|
||||
|
||||
auto pCmdWithPostSync = genCmdCast<L3_CONTROL_WITH_POST_SYNC *>(cmd);
|
||||
if (pCmdWithPostSync)
|
||||
if (pCmdWithPostSync) {
|
||||
return pCmdWithPostSync->getBase().TheStructure.Common.Length + 2;
|
||||
}
|
||||
|
||||
auto pCmdWithoutPostSync = genCmdCast<L3_CONTROL_WITHOUT_POST_SYNC *>(cmd);
|
||||
if (pCmdWithoutPostSync)
|
||||
if (pCmdWithoutPostSync) {
|
||||
return pCmdWithoutPostSync->getBase().TheStructure.Common.Length + 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -54,38 +56,45 @@ template <>
|
||||
size_t CmdParse<GenGfxFamily>::getCommandLengthHwSpecific(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<GPGPU_WALKER *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MEDIA_INTERFACE_DESCRIPTOR_LOAD *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MEDIA_VFE_STATE *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MEDIA_STATE_FLUSH *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_COMPUTE_MODE *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<GPGPU_CSR_BASE_ADDRESS *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_SIP *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
}
|
||||
|
||||
return getAdditionalCommandLengthHwSpecific(cmd);
|
||||
|
||||
@@ -147,11 +147,12 @@ class CCustomEventListener : public ::testing::TestEventListener {
|
||||
testsRun,
|
||||
testsPassed,
|
||||
testsSkipped);
|
||||
if (testsFailed > 0)
|
||||
if (testsFailed > 0) {
|
||||
fprintf(
|
||||
stdout,
|
||||
"Tests failed: %d\n",
|
||||
testsFailed);
|
||||
}
|
||||
|
||||
fprintf(
|
||||
stdout,
|
||||
@@ -162,14 +163,16 @@ class CCustomEventListener : public ::testing::TestEventListener {
|
||||
timeElapsed,
|
||||
paddingE.c_str());
|
||||
|
||||
for (auto failure : testFailures)
|
||||
for (auto failure : testFailures) {
|
||||
fprintf(
|
||||
stdout,
|
||||
"[ FAILED ][ %s ][ %u ] %s\n", hardwarePrefix.c_str(), failure.second, failure.first.c_str());
|
||||
if (unitTest.Failed())
|
||||
}
|
||||
if (unitTest.Failed()) {
|
||||
fprintf(
|
||||
stdout,
|
||||
"\n");
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
@@ -24,15 +24,19 @@ class StreamCapture {
|
||||
public:
|
||||
~StreamCapture() {
|
||||
#ifdef _WIN32
|
||||
if (pipefdStdout[0] != -1)
|
||||
if (pipefdStdout[0] != -1) {
|
||||
_close(pipefdStdout[0]);
|
||||
if (pipefdStderr[0] != -1)
|
||||
}
|
||||
if (pipefdStderr[0] != -1) {
|
||||
_close(pipefdStderr[0]);
|
||||
}
|
||||
#else
|
||||
if (pipefdStdout[0] != -1)
|
||||
if (pipefdStdout[0] != -1) {
|
||||
close(pipefdStdout[0]);
|
||||
if (pipefdStderr[0] != -1)
|
||||
}
|
||||
if (pipefdStderr[0] != -1) {
|
||||
close(pipefdStderr[0]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void captureStdout() {
|
||||
|
||||
@@ -180,10 +180,11 @@ class DrmMock : public Drm {
|
||||
return static_cast<uint32_t>(virtualMemoryIds.size());
|
||||
}
|
||||
bool useVMBindImmediate() const override {
|
||||
if (isVMBindImmediateSupported.has_value())
|
||||
if (isVMBindImmediateSupported.has_value()) {
|
||||
return *isVMBindImmediateSupported;
|
||||
else
|
||||
} else {
|
||||
return Drm::useVMBindImmediate();
|
||||
}
|
||||
}
|
||||
int queryGttSize(uint64_t >tSizeOutput, bool alignUpToFullRange) override {
|
||||
gttSizeOutput = storedGTTSize;
|
||||
|
||||
@@ -58,8 +58,9 @@ class MockIoctlHelper : public IoctlHelperPrelim20 {
|
||||
}
|
||||
|
||||
std::optional<uint32_t> getVmAdviseAtomicAttribute() override {
|
||||
if (callBaseVmAdviseAtomicAttribute)
|
||||
if (callBaseVmAdviseAtomicAttribute) {
|
||||
return IoctlHelperPrelim20::getVmAdviseAtomicAttribute();
|
||||
}
|
||||
return vmAdviseAtomicAttribute;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,10 +154,11 @@ class MockAubManager : public aub_stream::AubManager {
|
||||
bool mapGpuVa(uint64_t gfxAddress, size_t size, aub_stream::PhysicalAllocationInfo physicalAllocInfo) override { return false; };
|
||||
|
||||
uint32_t readMMIO(uint32_t offset) override {
|
||||
if (mmioData)
|
||||
if (mmioData) {
|
||||
return (*mmioData)[offset];
|
||||
else
|
||||
} else {
|
||||
return ::aub_stream::AubManager::readMMIO(offset);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<aub_stream::AllocationParams> storedAllocationParams;
|
||||
|
||||
@@ -246,8 +246,9 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
|
||||
}
|
||||
bool createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush) override {
|
||||
bool status = CommandStreamReceiver::createAllocationForHostSurface(surface, requiresL3Flush);
|
||||
if (status)
|
||||
if (status) {
|
||||
surface.getAllocation()->hostPtrTaskCountAssignment--;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
void postInitFlagsSetup() override {}
|
||||
|
||||
@@ -53,16 +53,18 @@ class MockCsrBase : public UltCommandStreamReceiver<GfxFamily> {
|
||||
|
||||
bool isMadeResident(GraphicsAllocation *gfxAllocation) {
|
||||
for (GraphicsAllocation *gfxAlloc : madeResidentGfxAllocations) {
|
||||
if (gfxAlloc == gfxAllocation)
|
||||
if (gfxAlloc == gfxAllocation) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isMadeNonResident(GraphicsAllocation *gfxAllocation) {
|
||||
for (GraphicsAllocation *gfxAlloc : madeNonResidentGfxAllocations) {
|
||||
if (gfxAlloc == gfxAllocation)
|
||||
if (gfxAlloc == gfxAllocation) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -141,8 +141,9 @@ ExecutionEnvironment *MockDevice::prepareExecutionEnvironment(const HardwareInfo
|
||||
}
|
||||
|
||||
bool MockDevice::verifyAdapterLuid() {
|
||||
if (callBaseVerifyAdapterLuid)
|
||||
if (callBaseVerifyAdapterLuid) {
|
||||
return Device::verifyAdapterLuid();
|
||||
}
|
||||
return verifyAdapterLuidReturnValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
* Copyright (C) 2022-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -42,8 +42,9 @@ bool MockRootDeviceEnvironment::initOsInterface(std::unique_ptr<HwDeviceId> &&hw
|
||||
bool MockRootDeviceEnvironment::initAilConfiguration() {
|
||||
if (ailInitializationResult.has_value()) {
|
||||
return *ailInitializationResult;
|
||||
} else
|
||||
} else {
|
||||
return RootDeviceEnvironment::initAilConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
MockRootDeviceEnvironment::~MockRootDeviceEnvironment() {
|
||||
|
||||
@@ -102,8 +102,9 @@ inline size_t mockFwrite(const void *ptr, size_t size, size_t nmemb, FILE *strea
|
||||
}
|
||||
|
||||
inline int mockFflush(FILE *stream) {
|
||||
if (stream == stdout || stream == stderr)
|
||||
if (stream == stdout || stream == stderr) {
|
||||
return fflush(stream);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,9 @@ class MockSettingsReader : public SettingsReader {
|
||||
|
||||
static SettingsReader *create(const std::string ®Key) {
|
||||
SettingsReader *readerImpl = MockSettingsReader::createFileReader();
|
||||
if (readerImpl != nullptr)
|
||||
if (readerImpl != nullptr) {
|
||||
return readerImpl;
|
||||
}
|
||||
|
||||
return createOsReader(false, regKey);
|
||||
}
|
||||
|
||||
@@ -43,8 +43,9 @@ void Ioctls::reset() {
|
||||
}
|
||||
|
||||
void DrmMockCustom::testIoctls() {
|
||||
if (this->ioctlExpected.total == -1)
|
||||
if (this->ioctlExpected.total == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
#define NEO_IOCTL_EXPECT_EQ(PARAM) \
|
||||
if (this->ioctlExpected.PARAM >= 0) { \
|
||||
|
||||
@@ -25,8 +25,9 @@ class DrmMockDefault : public DrmMock {
|
||||
storedRetValForPooledEU = 0;
|
||||
storedRetValForMinEUinPool = 0;
|
||||
|
||||
if (hwDeviceIdIn != nullptr)
|
||||
if (hwDeviceIdIn != nullptr) {
|
||||
this->hwDeviceId = std::move(hwDeviceIdIn);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -64,8 +64,9 @@ int DrmMockXe::ioctl(DrmIoctl request, void *arg) {
|
||||
} break;
|
||||
case DrmIoctl::gemVmDestroy: {
|
||||
struct drm_xe_vm_destroy *v = static_cast<struct drm_xe_vm_destroy *>(arg);
|
||||
if (v->vm_id == testValueVmId)
|
||||
if (v->vm_id == testValueVmId) {
|
||||
ret = 0;
|
||||
}
|
||||
} break;
|
||||
case DrmIoctl::gemMmapOffset: {
|
||||
gemMmapOffsetCalled++;
|
||||
|
||||
@@ -273,8 +273,9 @@ DWORD getFileAttributesA(LPCSTR lpFileName) {
|
||||
}
|
||||
|
||||
for (const auto &[path, attributes] : pathAttributes) {
|
||||
if (path.empty())
|
||||
if (path.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string tempP2 = path;
|
||||
if (tempP2.back() == PATH_SEPARATOR) {
|
||||
|
||||
@@ -30,8 +30,9 @@ template <>
|
||||
size_t CmdParse<GenGfxFamily>::getAdditionalCommandLength(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<L3_CONTROL *>(cmd);
|
||||
if (pCmd)
|
||||
if (pCmd) {
|
||||
return pCmd->TheStructure.Common.Length + 2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -199,10 +199,12 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDepreca
|
||||
|
||||
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
|
||||
auto hardwareInfo = hardwareInfoTable[i];
|
||||
if (hardwareInfo == nullptr)
|
||||
if (hardwareInfo == nullptr) {
|
||||
continue;
|
||||
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily)
|
||||
}
|
||||
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
|
||||
@@ -379,10 +381,12 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknown
|
||||
EXPECT_NE(nullptr, hwInfo);
|
||||
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
|
||||
auto hardwareInfo = hardwareInfoTable[i];
|
||||
if (hardwareInfo == nullptr)
|
||||
if (hardwareInfo == nullptr) {
|
||||
continue;
|
||||
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily)
|
||||
}
|
||||
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
|
||||
ASSERT_NE(nullptr, hardwarePrefix[i]);
|
||||
|
||||
@@ -994,8 +994,9 @@ struct MyMockWddmDirectSubmission : public MockWddmDirectSubmission<GfxFamily, D
|
||||
using BaseClass::MockWddmDirectSubmission;
|
||||
void updateMonitorFenceValueForResidencyList(ResidencyContainer *allocationsForResidency) override {
|
||||
lockInTesting = true;
|
||||
while (lockInTesting)
|
||||
while (lockInTesting) {
|
||||
;
|
||||
}
|
||||
BaseClass::updateMonitorFenceValueForResidencyList(allocationsForResidency);
|
||||
}
|
||||
std::atomic<bool> lockInTesting = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -264,10 +264,11 @@ TYPED_TEST_SUITE(IsAlignedTests, IsAlignedTypes);
|
||||
TYPED_TEST(IsAlignedTests, WhenCheckingForAlignmentThenReturnCorrectValue) {
|
||||
TypeParam *ptr = reinterpret_cast<TypeParam *>(static_cast<uintptr_t>(0xdeadbeefu));
|
||||
// one byte alignment should always return true
|
||||
if (alignof(TypeParam) == 1)
|
||||
if (alignof(TypeParam) == 1) {
|
||||
EXPECT_TRUE(isAligned(ptr));
|
||||
else
|
||||
} else {
|
||||
EXPECT_FALSE(isAligned(ptr));
|
||||
}
|
||||
|
||||
auto ptr1 = reinterpret_cast<TypeParam *>(reinterpret_cast<uintptr_t>(ptr) & ~(alignof(TypeParam) - 1));
|
||||
EXPECT_TRUE(isAligned(ptr1));
|
||||
@@ -276,8 +277,9 @@ TYPED_TEST(IsAlignedTests, WhenCheckingForAlignmentThenReturnCorrectValue) {
|
||||
EXPECT_TRUE(isAligned(ptr2));
|
||||
|
||||
// this is hard to align in the middle of byte aligned types
|
||||
if (alignof(TypeParam) == 1)
|
||||
if (alignof(TypeParam) == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto ptr3 = reinterpret_cast<TypeParam *>(reinterpret_cast<uintptr_t>(ptr) & ~((alignof(TypeParam) >> 1) - 1));
|
||||
EXPECT_FALSE(isAligned(ptr3));
|
||||
|
||||
@@ -440,8 +440,9 @@ struct LocalIdsLayoutForImagesTest : ::testing::TestWithParam<std::tuple<uint16_
|
||||
uint16_t baseY = buffer[i * 3 * rowWidth + rowWidth];
|
||||
uint16_t currentX = baseX;
|
||||
for (int j = 1; j < simd; j++) {
|
||||
if (simd * i + j == totalLocalIds)
|
||||
if (simd * i + j == totalLocalIds) {
|
||||
break;
|
||||
}
|
||||
if (simd == 32u && baseY + 8u > localWorkSize.at(1) && j == 16u) {
|
||||
baseX += xDelta;
|
||||
if (baseX == localWorkSize.at(0)) {
|
||||
@@ -454,8 +455,9 @@ struct LocalIdsLayoutForImagesTest : ::testing::TestWithParam<std::tuple<uint16_
|
||||
|
||||
// validate Y row
|
||||
for (int j = 0; j < simd; j++) {
|
||||
if (simd * i + j == totalLocalIds)
|
||||
if (simd * i + j == totalLocalIds) {
|
||||
break;
|
||||
}
|
||||
uint16_t expectedY = baseY + ((j / xDelta) & 0b111);
|
||||
if (expectedY >= localWorkSize.at(1)) {
|
||||
expectedY -= (localWorkSize.at(1) - baseY);
|
||||
@@ -465,8 +467,9 @@ struct LocalIdsLayoutForImagesTest : ::testing::TestWithParam<std::tuple<uint16_
|
||||
|
||||
// validate Z row
|
||||
for (int j = 0; j < simd; j++) {
|
||||
if (simd * i + j == totalLocalIds)
|
||||
if (simd * i + j == totalLocalIds) {
|
||||
break;
|
||||
}
|
||||
EXPECT_EQ(buffer[i * 3 * rowWidth + 2 * rowWidth + j], 0u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -34,15 +34,17 @@ TEST(StringHelpers, GivenParamsWhenUsingStrncpyThenReturnIsCorrect) {
|
||||
ret = strncpy_s(dst, 1024, src, strlen(src) / 2);
|
||||
EXPECT_EQ(ret, 0);
|
||||
EXPECT_EQ(0, memcmp(dst, src, strlen(src) / 2));
|
||||
for (size_t i = strlen(src) / 2; i < sizeof(dst); i++)
|
||||
for (size_t i = strlen(src) / 2; i < sizeof(dst); i++) {
|
||||
EXPECT_EQ(0, dst[i]);
|
||||
}
|
||||
|
||||
ret = strncpy_s(dst, 1024, src, 1024);
|
||||
ASSERT_EQ(0, ret);
|
||||
|
||||
EXPECT_EQ(0, memcmp(dst, src, strlen(src)));
|
||||
for (size_t i = strlen(src); i < sizeof(dst); i++)
|
||||
for (size_t i = strlen(src); i < sizeof(dst); i++) {
|
||||
EXPECT_EQ(0, dst[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(StringHelpers, GivenCountGreaterEqualToNumberOfElementsThenReturnErangeAndSetFirstStringToNullTerminator) {
|
||||
@@ -126,8 +128,9 @@ TEST(StringHelpers, GivenParamsWhenUsingStrcpyThenReturnIsCorrect) {
|
||||
EXPECT_EQ(ret, 0);
|
||||
EXPECT_EQ(0, memcmp(dst, src, strlen(src)));
|
||||
EXPECT_EQ(0, dst[strlen(src)]);
|
||||
for (size_t i = strlen(src) + 1; i < sizeof(dst); i++)
|
||||
for (size_t i = strlen(src) + 1; i < sizeof(dst); i++) {
|
||||
EXPECT_EQ(pattern, dst[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(StringHelpers, GivenParamsWhenUsingStrnlenThenReturnIsCorrect) {
|
||||
@@ -165,8 +168,9 @@ TEST(StringHelpers, GivenParamsWhenUsingMemcpyThenReturnIsCorrect) {
|
||||
ret = memcpy_s(dst, sizeof(dst), src, strlen(src) / 2);
|
||||
EXPECT_EQ(ret, 0);
|
||||
EXPECT_EQ(0, memcmp(dst, src, strlen(src) / 2));
|
||||
for (size_t i = strlen(src) / 2; i < sizeof(dst); i++)
|
||||
for (size_t i = strlen(src) / 2; i < sizeof(dst); i++) {
|
||||
EXPECT_EQ(0, dst[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -66,8 +66,9 @@ TEST_F(DeferrableAllocationDeletionTest, givenDeferrableAllocationWhenApplyThenW
|
||||
allocation->updateTaskCount(1u, defaultOsContextId);
|
||||
*hwTag = 0u;
|
||||
asyncDeleter->deferDeletion(new DeferrableAllocationDeletion(*memoryManager, *allocation));
|
||||
while (!asyncDeleter->queue.peekIsEmpty()) // wait for async thread to get allocation from queue
|
||||
while (!asyncDeleter->queue.peekIsEmpty()) { // wait for async thread to get allocation from queue
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryCalled);
|
||||
EXPECT_TRUE(allocation->isUsedByOsContext(defaultOsContextId));
|
||||
@@ -76,8 +77,9 @@ TEST_F(DeferrableAllocationDeletionTest, givenDeferrableAllocationWhenApplyThenW
|
||||
asyncDeleter->allowExit = true;
|
||||
|
||||
*hwTag = 1u; // allow to destroy allocation
|
||||
while (!asyncDeleter->shouldStopReached)
|
||||
while (!asyncDeleter->shouldStopReached) {
|
||||
std::this_thread::yield();
|
||||
}
|
||||
EXPECT_EQ(1u, memoryManager->freeGraphicsMemoryCalled);
|
||||
}
|
||||
|
||||
@@ -109,8 +111,9 @@ HWTEST_F(DeferrableAllocationDeletionTest, givenDeferrableAllocationDeletionWhen
|
||||
auto deferrableAlloc = new DeferrableAllocationDeletionApplyCall(*memoryManager, *allocation);
|
||||
EXPECT_FALSE(deferrableAlloc->applyCalled);
|
||||
asyncDeleter->deferDeletion(deferrableAlloc);
|
||||
while (!deferrableAlloc->applyCalled)
|
||||
while (!deferrableAlloc->applyCalled) {
|
||||
std::this_thread::yield();
|
||||
}
|
||||
*hwTag = 2u;
|
||||
*nonDefaultCommandStreamReceiver.getTagAddress() = 2u;
|
||||
EXPECT_FALSE(nonDefaultCommandStreamReceiver.flushBatchedSubmissionsCalled);
|
||||
@@ -136,8 +139,9 @@ HWTEST_F(DeferrableAllocationDeletionTest, givenAllocationUsedByTwoOsContextsWhe
|
||||
EXPECT_FALSE(device->getUltCommandStreamReceiver<FamilyType>().flushBatchedSubmissionsCalled);
|
||||
EXPECT_FALSE(nonDefaultCommandStreamReceiver.flushBatchedSubmissionsCalled);
|
||||
asyncDeleter->deferDeletion(new DeferrableAllocationDeletion(*memoryManager, *allocation));
|
||||
while (allocation->isUsedByOsContext(nonDefaultOsContextId) && !device->getUltCommandStreamReceiver<FamilyType>().flushBatchedSubmissionsCalled) // wait for second context completion signal
|
||||
while (allocation->isUsedByOsContext(nonDefaultOsContextId) && !device->getUltCommandStreamReceiver<FamilyType>().flushBatchedSubmissionsCalled) { // wait for second context completion signal
|
||||
std::this_thread::yield();
|
||||
}
|
||||
EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryCalled);
|
||||
EXPECT_FALSE(nonDefaultCommandStreamReceiver.flushBatchedSubmissionsCalled);
|
||||
asyncDeleter->allowExit = true;
|
||||
@@ -155,8 +159,9 @@ HWTEST_F(DeferrableAllocationDeletionTest, givenDeferrableAllocationDeletionWhen
|
||||
allocation->updateTaskCount(1u, defaultOsContextId);
|
||||
auto used = nonDefaultCommandStreamReceiver.getCS(0u).getUsed();
|
||||
asyncDeleter->deferDeletion(new DeferrableAllocationDeletion(*memoryManager, *allocation));
|
||||
while (allocation->isUsedByOsContext(nonDefaultOsContextId) && !device->getUltCommandStreamReceiver<FamilyType>().flushBatchedSubmissionsCalled) // wait for second context completion signal
|
||||
while (allocation->isUsedByOsContext(nonDefaultOsContextId) && !device->getUltCommandStreamReceiver<FamilyType>().flushBatchedSubmissionsCalled) { // wait for second context completion signal
|
||||
std::this_thread::yield();
|
||||
}
|
||||
EXPECT_FALSE(nonDefaultCommandStreamReceiver.flushBatchedSubmissionsCalled);
|
||||
EXPECT_EQ(used, nonDefaultCommandStreamReceiver.getCS(0u).getUsed());
|
||||
asyncDeleter->allowExit = true;
|
||||
@@ -167,14 +172,16 @@ TEST_F(DeferrableAllocationDeletionTest, givenNotUsedAllocationWhenApplyDeletion
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
EXPECT_FALSE(allocation->isUsed());
|
||||
EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryCalled);
|
||||
while (!asyncDeleter->doWorkInBackground)
|
||||
while (!asyncDeleter->doWorkInBackground) {
|
||||
std::this_thread::yield(); // wait for start async thread work
|
||||
}
|
||||
std::unique_lock<std::mutex> lock(asyncDeleter->queueMutex);
|
||||
asyncDeleter->allowExit = true;
|
||||
lock.unlock();
|
||||
asyncDeleter->deferDeletion(new DeferrableAllocationDeletion(*memoryManager, *allocation));
|
||||
while (!asyncDeleter->shouldStopReached) // wait async thread job end
|
||||
while (!asyncDeleter->shouldStopReached) { // wait async thread job end
|
||||
std::this_thread::yield();
|
||||
}
|
||||
EXPECT_EQ(1u, memoryManager->freeGraphicsMemoryCalled);
|
||||
}
|
||||
|
||||
@@ -189,8 +196,9 @@ TEST_F(DeferrableAllocationDeletionTest, givenTwoAllocationsUsedByOneOsContextsE
|
||||
EXPECT_TRUE(allocation2->isUsed());
|
||||
asyncDeleter->deferDeletion(new DeferrableAllocationDeletion(*memoryManager, *allocation1));
|
||||
asyncDeleter->deferDeletion(new DeferrableAllocationDeletion(*memoryManager, *allocation2));
|
||||
while (0u == memoryManager->freeGraphicsMemoryCalled) // wait for delete second allocation
|
||||
while (0u == memoryManager->freeGraphicsMemoryCalled) { // wait for delete second allocation
|
||||
std::this_thread::yield();
|
||||
}
|
||||
EXPECT_EQ(1u, memoryManager->freeGraphicsMemoryCalled);
|
||||
asyncDeleter->allowExit = true;
|
||||
*hwTag = 2u;
|
||||
|
||||
@@ -273,8 +273,9 @@ TEST_F(InternalAllocationStorageTest, givenAllocationListWhenTwoThreadsCleanConc
|
||||
storage->cleanAllocationList(2, TEMPORARY_ALLOCATION);
|
||||
});
|
||||
|
||||
while (!allocation1->inDestructor)
|
||||
while (!allocation1->inDestructor) {
|
||||
;
|
||||
}
|
||||
lock.unlock();
|
||||
allocationDeletionLock.unlock();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -79,9 +79,11 @@ class PPGTTPageTable : public std::conditional<is64bit, PML4, PDPE>::type {
|
||||
EXPECT_EQ(ppgttEntries, entries.size());
|
||||
}
|
||||
bool isEmpty() {
|
||||
for (const auto &e : entries)
|
||||
if (e != nullptr)
|
||||
for (const auto &e : entries) {
|
||||
if (e != nullptr) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -92,9 +94,11 @@ class GGTTPageTable : public PDPE {
|
||||
EXPECT_EQ(4u, entries.size());
|
||||
}
|
||||
bool isEmpty() {
|
||||
for (const auto &e : entries)
|
||||
if (e != nullptr)
|
||||
for (const auto &e : entries) {
|
||||
if (e != nullptr) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -125,8 +125,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenCommandStreamWhenItIsFlush
|
||||
auto bo = drmAllocation->getBO();
|
||||
|
||||
// spin until gem close worker finishes execution
|
||||
while (bo->getRefCount() > 1)
|
||||
while (bo->getRefCount() > 1) {
|
||||
;
|
||||
}
|
||||
|
||||
mm->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
@@ -2519,8 +2519,9 @@ HWTEST_TEMPLATED_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndThreeOsHandlesW
|
||||
|
||||
for (unsigned int i = 0; i < 3; ++i) {
|
||||
expectedRefCount = i < 2 ? i + 1 : 1;
|
||||
if (i == 2)
|
||||
if (i == 2) {
|
||||
this->mock->outputHandle = 3u;
|
||||
}
|
||||
|
||||
AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::sharedBuffer, false, mockDeviceBitfield);
|
||||
TestedDrmMemoryManager::OsHandleData osHandleData{handles[i]};
|
||||
@@ -2550,8 +2551,9 @@ HWTEST_TEMPLATED_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndThreeOsHandlesW
|
||||
|
||||
for (const auto &it : graphicsAllocations) {
|
||||
// Clang-tidy false positive WA
|
||||
if (it != nullptr)
|
||||
if (it != nullptr) {
|
||||
memoryManager->freeGraphicsMemory(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,9 @@ struct DrmMockXeCcs : public DrmMockCustom {
|
||||
} break;
|
||||
case DrmIoctl::gemVmDestroy: {
|
||||
struct drm_xe_vm_destroy *v = static_cast<struct drm_xe_vm_destroy *>(arg);
|
||||
if (v->vm_id == testValueVmId)
|
||||
if (v->vm_id == testValueVmId) {
|
||||
ret = 0;
|
||||
}
|
||||
} break;
|
||||
case DrmIoctl::gemMmapOffset: {
|
||||
gemMmapOffsetCalled++;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -65,8 +65,9 @@ DWORD WINAPI getModuleFileNameAMock(HMODULE hModule, LPSTR lpFilename, DWORD nSi
|
||||
}
|
||||
|
||||
HMODULE WINAPI loadLibraryExAMock(LPCSTR lpFileName, HANDLE hFile, DWORD dwFlags) {
|
||||
if (mockWillFailInNonSystem32 && dwFlags != LOAD_LIBRARY_SEARCH_SYSTEM32)
|
||||
if (mockWillFailInNonSystem32 && dwFlags != LOAD_LIBRARY_SEARCH_SYSTEM32) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char fName[MAX_PATH];
|
||||
auto lenFn = strlen(lpFileName);
|
||||
|
||||
@@ -614,10 +614,11 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandlesWhenCreateGraphicsAllocation
|
||||
|
||||
EXPECT_EQ(4096u, wddmAllocation->getDefaultGmm()->gmmResourceInfo->getSizeAllocation());
|
||||
|
||||
if (i % 2)
|
||||
if (i % 2) {
|
||||
EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_IMAGE, reinterpret_cast<MockGmmResourceInfo *>(wddmAllocation->getDefaultGmm()->gmmResourceInfo.get())->getResourceUsage());
|
||||
else
|
||||
} else {
|
||||
EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER, reinterpret_cast<MockGmmResourceInfo *>(wddmAllocation->getDefaultGmm()->gmmResourceInfo.get())->getResourceUsage());
|
||||
}
|
||||
|
||||
mm.freeGraphicsMemory(graphicsAllocation);
|
||||
auto destroyWithResourceHandleCalled = 0u;
|
||||
|
||||
@@ -2843,10 +2843,11 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIs
|
||||
EXPECT_EQ(NT_ALLOCATION_HANDLE, wddmAlloc->getDefaultHandle());
|
||||
EXPECT_EQ(AllocationType::sharedImage, wddmAlloc->getAllocationType());
|
||||
|
||||
if (i % 2)
|
||||
if (i % 2) {
|
||||
EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_IMAGE, reinterpret_cast<MockGmmResourceInfo *>(wddmAlloc->getDefaultGmm()->gmmResourceInfo.get())->getResourceUsage());
|
||||
else
|
||||
} else {
|
||||
EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER, reinterpret_cast<MockGmmResourceInfo *>(wddmAlloc->getDefaultGmm()->gmmResourceInfo.get())->getResourceUsage());
|
||||
}
|
||||
|
||||
memoryManager->freeGraphicsMemory(gpuAllocation);
|
||||
}
|
||||
|
||||
@@ -91,9 +91,9 @@ class PrintFormatterTest : public testing::Test {
|
||||
void storeData(T value) {
|
||||
T *valuePointer = reinterpret_cast<T *>(underlyingBuffer + offset);
|
||||
|
||||
if (isAligned(valuePointer))
|
||||
if (isAligned(valuePointer)) {
|
||||
*valuePointer = value;
|
||||
else {
|
||||
} else {
|
||||
memcpy_s(valuePointer, sizeof(underlyingBuffer) - offset, &value, sizeof(T));
|
||||
}
|
||||
|
||||
@@ -443,8 +443,9 @@ TEST_P(PrintfDoubleTest, GivenFormatContainingDoubleWhenPrintingThenValueIsInser
|
||||
|
||||
printFormatter->printKernelOutput([&actualOutput](char *str) { strncpy_s(actualOutput, maxPrintfOutputLength, str, maxPrintfOutputLength - 1); });
|
||||
|
||||
if (input.format[input.format.length() - 1] == 'F')
|
||||
if (input.format[input.format.length() - 1] == 'F') {
|
||||
input.format[input.format.length() - 1] = 'f';
|
||||
}
|
||||
|
||||
snprintf(referenceOutput, sizeof(referenceOutput), input.format.c_str(), input.value);
|
||||
|
||||
@@ -623,8 +624,9 @@ TEST_F(PrintFormatterTest, GivenVector2WhenPrintingThenAllValuesAreInserted) {
|
||||
storeData(channelCount);
|
||||
|
||||
// channel values
|
||||
for (int i = 0; i < channelCount; i++)
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
storeData(i + 1);
|
||||
}
|
||||
|
||||
char actualOutput[maxPrintfOutputLength];
|
||||
|
||||
@@ -644,8 +646,9 @@ TEST_F(PrintFormatterTest, GivenVector4WhenPrintingThenAllValuesAreInserted) {
|
||||
storeData(channelCount);
|
||||
|
||||
// channel values
|
||||
for (int i = 0; i < channelCount; i++)
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
storeData(i + 1);
|
||||
}
|
||||
|
||||
char actualOutput[maxPrintfOutputLength];
|
||||
|
||||
@@ -665,8 +668,9 @@ TEST_F(PrintFormatterTest, GivenVector8WhenPrintingThenAllValuesAreInserted) {
|
||||
storeData(channelCount);
|
||||
|
||||
// channel values
|
||||
for (int i = 0; i < channelCount; i++)
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
storeData(i + 1);
|
||||
}
|
||||
|
||||
char actualOutput[maxPrintfOutputLength];
|
||||
|
||||
@@ -686,8 +690,9 @@ TEST_F(PrintFormatterTest, GivenVector16WhenPrintingThenAllValuesAreInserted) {
|
||||
storeData(channelCount);
|
||||
|
||||
// channel values
|
||||
for (int i = 0; i < channelCount; i++)
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
storeData(i + 1);
|
||||
}
|
||||
|
||||
char actualOutput[maxPrintfOutputLength];
|
||||
|
||||
@@ -901,24 +906,28 @@ TEST_F(PrintFormatterTest, Given2ByteVectorsWhenPrintingThenDataBufferParsedProp
|
||||
storeData(channelCount);
|
||||
|
||||
// channel values
|
||||
for (int i = 0; i < channelCount; i++)
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
storeData(static_cast<int8_t>(i + 1));
|
||||
}
|
||||
|
||||
// filler, should not be printed
|
||||
for (int i = 0; i < 12; i++)
|
||||
for (int i = 0; i < 12; i++) {
|
||||
storeData(static_cast<int8_t>(0));
|
||||
}
|
||||
|
||||
storeData(PrintfDataType::vectorByteType);
|
||||
// channel count
|
||||
storeData(channelCount);
|
||||
|
||||
// channel values
|
||||
for (int i = 0; i < channelCount; i++)
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
storeData(static_cast<int8_t>(i + 1));
|
||||
}
|
||||
|
||||
// filler, should not be printed
|
||||
for (int i = 0; i < 12; i++)
|
||||
for (int i = 0; i < 12; i++) {
|
||||
storeData(static_cast<int8_t>(0));
|
||||
}
|
||||
|
||||
char actualOutput[maxPrintfOutputLength];
|
||||
|
||||
|
||||
@@ -736,8 +736,9 @@ TEST(HeapAllocatorTest, WhenMemoryIsAllocatedThenAllocationsDoNotOverlap) {
|
||||
sizes[i] = sizeToAllocate;
|
||||
ptrs[i] = heapAllocator->allocate(sizes[i]);
|
||||
|
||||
if (ptrs[i] == 0llu)
|
||||
if (ptrs[i] == 0llu) {
|
||||
break;
|
||||
}
|
||||
|
||||
uint8_t *pTemp = reinterpret_cast<uint8_t *>(ptrs[i]);
|
||||
for (uint32_t j = 0; j < sizes[i] / 4096; j++) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -35,8 +35,9 @@ TEST(SpinLockTest, givenTwoThreadsThenVerifyThatTheySynchronizeWithSpinLock) {
|
||||
});
|
||||
|
||||
// Wait till worker thread is started
|
||||
while (!threadStarted)
|
||||
while (!threadStarted) {
|
||||
;
|
||||
}
|
||||
sharedCount++;
|
||||
EXPECT_EQ(1, sharedCount);
|
||||
|
||||
@@ -44,8 +45,9 @@ TEST(SpinLockTest, givenTwoThreadsThenVerifyThatTheySynchronizeWithSpinLock) {
|
||||
lock1.unlock();
|
||||
|
||||
// Wait till worker thread finishes
|
||||
while (!threadFinished)
|
||||
while (!threadFinished) {
|
||||
;
|
||||
}
|
||||
EXPECT_EQ(2, sharedCount);
|
||||
workerThread.join();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user