fix: neo ULT build with optimizations disabled 1/n

Related-To: NEO-8116

Signed-off-by: Oskar Hubert Weber <oskar.hubert.weber@intel.com>
This commit is contained in:
Oskar Hubert Weber
2024-10-28 12:14:46 +00:00
committed by Compute-Runtime-Automation
parent 94d28f3306
commit fd45b2883d
8 changed files with 37 additions and 32 deletions

View File

@@ -4137,7 +4137,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
HWTEST2_F(MultipleDevicePeerAllocationTest,
whenFreeingNotKnownPointerThenInvalidArgumentIsReturned,
MatchAny) {
void *ptr = malloc(1u);
void *ptr = calloc(1, 1u);
ze_result_t result = context->freeMem(ptr);
EXPECT_EQ(result, ZE_RESULT_ERROR_INVALID_ARGUMENT);
free(ptr);

View File

@@ -107,26 +107,28 @@ ze_result_t MultiDeviceCreatedMetricGroupManager::createMultipleMetricGroupsFrom
multiDeviceMetricImp.push_back(static_cast<MultiDeviceMetricImp *>(Metric::fromHandle(hMetric)));
}
auto metricGroup = T::create(metricSource, metricGroupsAcrossSubDevices, multiDeviceMetricImp);
auto closeStatus = metricGroup->close();
if (closeStatus != ZE_RESULT_SUCCESS) {
// Cleanup and exit
metricGroup->destroy();
for (auto &metricGroupCreated : metricGroupList) {
MetricGroup::fromHandle(metricGroupCreated)->destroy();
}
metricGroupList.clear();
// Delete the remaining subdevice groups
for (uint32_t subDevGroupIndex = groupIndex + 1; subDevGroupIndex < static_cast<uint32_t>(metricGroupsPerSubDevice[0].size()); subDevGroupIndex++) {
for (uint32_t subDeviceIndex = 0; subDeviceIndex < subDeviceCount; subDeviceIndex++) {
[[maybe_unused]] auto status = zetMetricGroupDestroyExp(metricGroupsPerSubDevice[subDeviceIndex][subDevGroupIndex]);
DEBUG_BREAK_IF(status != ZE_RESULT_SUCCESS);
if (metricGroup) {
auto closeStatus = metricGroup->close();
if (closeStatus != ZE_RESULT_SUCCESS) {
// Cleanup and exit
metricGroup->destroy();
for (auto &metricGroupCreated : metricGroupList) {
MetricGroup::fromHandle(metricGroupCreated)->destroy();
}
metricGroupList.clear();
// Delete the remaining subdevice groups
for (uint32_t subDevGroupIndex = groupIndex + 1; subDevGroupIndex < static_cast<uint32_t>(metricGroupsPerSubDevice[0].size()); subDevGroupIndex++) {
for (uint32_t subDeviceIndex = 0; subDeviceIndex < subDeviceCount; subDeviceIndex++) {
[[maybe_unused]] auto status = zetMetricGroupDestroyExp(metricGroupsPerSubDevice[subDeviceIndex][subDevGroupIndex]);
DEBUG_BREAK_IF(status != ZE_RESULT_SUCCESS);
}
}
*maxMetricGroupCount = 0;
return closeStatus;
}
*maxMetricGroupCount = 0;
return closeStatus;
metricGroupList.push_back(metricGroup);
}
metricGroupList.push_back(metricGroup);
}
*maxMetricGroupCount = static_cast<uint32_t>(metricGroupList.size());

View File

@@ -5909,7 +5909,7 @@ TEST_F(DebugApiLinuxTest, givenEnginesEventHandledThenLrcToContextHandleMapIsFil
session->handleEvent(&client.base);
unsigned char bytes1[sizeof(prelim_drm_i915_debug_event_engines) + 2 * sizeof(prelim_drm_i915_debug_engine_info)];
prelim_drm_i915_debug_event_engines *engines1 = reinterpret_cast<prelim_drm_i915_debug_event_engines *>(bytes1);
prelim_drm_i915_debug_event_engines *engines1 = new (bytes1) prelim_drm_i915_debug_event_engines;
engines1->base.type = PRELIM_DRM_I915_DEBUG_EVENT_ENGINES;
engines1->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE;
engines1->client_handle = clientHandle;
@@ -5919,7 +5919,7 @@ TEST_F(DebugApiLinuxTest, givenEnginesEventHandledThenLrcToContextHandleMapIsFil
engines1->engines[1].lrc_handle = 2;
unsigned char bytes2[sizeof(prelim_drm_i915_debug_event_engines) + 4 * sizeof(prelim_drm_i915_debug_engine_info)];
prelim_drm_i915_debug_event_engines *engines2 = reinterpret_cast<prelim_drm_i915_debug_event_engines *>(bytes2);
prelim_drm_i915_debug_event_engines *engines2 = new (bytes2) prelim_drm_i915_debug_event_engines;
engines2->base.type = PRELIM_DRM_I915_DEBUG_EVENT_ENGINES;
engines2->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE;
engines2->client_handle = clientHandle;

View File

@@ -112,7 +112,7 @@ TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenReadingContextState
EXPECT_TRUE(session->stateSaveAreaHeader.empty());
const char *header = "cssa";
rootSession->stateSaveAreaHeader.assign(header, header + sizeof(header));
rootSession->stateSaveAreaHeader.assign(header, header + strlen(header) + 1);
session->readStateSaveAreaHeader();
EXPECT_FALSE(session->stateSaveAreaHeader.empty());
@@ -134,7 +134,7 @@ TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenReadingContextState
ASSERT_NE(nullptr, session);
const char *header = "cssa";
rootSession->stateSaveAreaHeader.assign(header, header + sizeof(header));
rootSession->stateSaveAreaHeader.assign(header, header + strlen(header) + 1);
rootSession->sipSupportsSlm = false;
session->readStateSaveAreaHeader();

View File

@@ -1217,15 +1217,17 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueCommandWithoutKernel(
if (enqueueProperties.operation == EnqueueProperties::Operation::blit) {
UNRECOVERABLE_IF(!enqueueProperties.blitPropertiesContainer);
const auto newTaskCount = bcsCsr->flushBcsTask(*enqueueProperties.blitPropertiesContainer, false, this->isProfilingEnabled(), getDevice());
if (newTaskCount > CompletionStamp::notReady) {
CompletionStamp completionStamp{};
completionStamp.taskCount = newTaskCount;
if (bcsCsr) {
const auto newTaskCount = bcsCsr->flushBcsTask(*enqueueProperties.blitPropertiesContainer, false, this->isProfilingEnabled(), getDevice());
if (newTaskCount > CompletionStamp::notReady) {
CompletionStamp completionStamp{};
completionStamp.taskCount = newTaskCount;
return completionStamp;
return completionStamp;
}
this->updateBcsTaskCount(bcsCsr->getOsContext().getEngineType(), newTaskCount);
}
this->updateBcsTaskCount(bcsCsr->getOsContext().getEngineType(), newTaskCount);
}
return completionStamp;

View File

@@ -191,8 +191,7 @@ class MockKernel : public Kernel {
crossThreadDataSize = 0;
}
if (crossThreadDataPattern && (newCrossThreadDataSize > 0)) {
mockCrossThreadData.clear();
mockCrossThreadData.insert(mockCrossThreadData.begin(), (char *)crossThreadDataPattern, ((char *)crossThreadDataPattern) + newCrossThreadDataSize);
mockCrossThreadData.assign((char *)crossThreadDataPattern, ((char *)crossThreadDataPattern) + newCrossThreadDataSize);
} else {
mockCrossThreadData.resize(newCrossThreadDataSize, 0);
}

View File

@@ -30,6 +30,8 @@
namespace NEO {
LinkerInput::~LinkerInput() = default;
SegmentType LinkerInput::getSegmentForSection(ConstStringRef name) {
if (name == NEO::Zebin::Elf::SectionNames::dataConst || name == NEO::Zebin::Elf::SectionNames::dataGlobalConst) {
return NEO::SegmentType::globalConstants;

View File

@@ -109,7 +109,7 @@ struct LinkerInput {
using SymbolMap = std::unordered_map<std::string, SymbolInfo>;
using RelocationsPerInstSegment = std::vector<Relocations>;
virtual ~LinkerInput() = default;
virtual ~LinkerInput();
static SegmentType getSegmentForSection(ConstStringRef name);