mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Handle legacy hasBarriers properly
Previous change regarding NEO-6785 added encoding of number of barriers to specific value representation depending on hardware that we program for. In patch token format encoding of number of barriers is sent via hasBarriers field in a token. In zebin true number of barriers is sent via barrier_count field in zeInfo. To remove this discrepancy, translate encoded number of barriers into true number of barriers in legacy format. Resolves: NEO-6785 Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
884d729e4e
commit
ee0d183cf9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "shared/source/device_binary_format/patchtokens_dumper.h"
|
||||
#include "shared/source/device_binary_format/patchtokens_validator.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/program/kernel_info.h"
|
||||
#include "shared/source/program/program_info_from_patchtokens.h"
|
||||
#include "shared/source/utilities/logger.h"
|
||||
|
||||
@@ -57,6 +59,14 @@ DecodeError decodeSingleDeviceBinary<NEO::DeviceBinaryFormat::Patchtokens>(Progr
|
||||
|
||||
NEO::populateProgramInfo(dst, decodedProgram);
|
||||
|
||||
// set barrierCount to number of barriers decoded from hasBarriers token
|
||||
UNRECOVERABLE_IF(src.targetDevice.coreFamily == IGFX_UNKNOWN_CORE);
|
||||
auto &hwHelper = NEO::HwHelper::get(src.targetDevice.coreFamily);
|
||||
for (auto &ki : dst.kernelInfos) {
|
||||
auto &kd = ki->kernelDescriptor;
|
||||
kd.kernelAttributes.barrierCount = hwHelper.getBarriersCountFromHasBarriers(kd.kernelAttributes.barrierCount);
|
||||
}
|
||||
|
||||
return DecodeError::Success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user