Refactor HardwareCommandsHelper

Change-Id: I15dcbf445565228a0e520b25265a1752ead70a28
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-04-03 10:50:54 +02:00
committed by sys_ocldev
parent 9dc7e2cfaf
commit 4786f1a6c2
3 changed files with 13 additions and 9 deletions

View File

@ -42,11 +42,15 @@ struct HardwareCommandsHelper : public PerThreadDataHelper {
uint64_t offsetInterfaceDescriptor,
INTERFACE_DESCRIPTOR_DATA *inlineInterfaceDescriptor);
static void setAdditionalInfo(
static void setGrfInfo(
INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor,
const Kernel &kernel,
const size_t &sizeCrossThreadData,
const size_t &sizePerThreadData,
const size_t &sizePerThreadData);
static void setAdditionalInfo(
INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor,
const Kernel &kernel,
const uint32_t threadsPerThreadGroup);
inline static uint32_t additionalSizeRequiredDsh();

View File

@ -194,7 +194,8 @@ size_t HardwareCommandsHelper<GfxFamily>::sendInterfaceDescriptorData(
pInterfaceDescriptor->setDenormMode(INTERFACE_DESCRIPTOR_DATA::DENORM_MODE_SETBYKERNEL);
setAdditionalInfo(pInterfaceDescriptor, kernel, sizeCrossThreadData, sizePerThreadData, threadsPerThreadGroup);
setGrfInfo(pInterfaceDescriptor, kernel, sizeCrossThreadData, sizePerThreadData);
setAdditionalInfo(pInterfaceDescriptor, kernel, threadsPerThreadGroup);
pInterfaceDescriptor->setBindingTablePointer(static_cast<uint32_t>(bindingTablePointer));

View File

@ -25,12 +25,8 @@ typename HardwareCommandsHelper<GfxFamily>::INTERFACE_DESCRIPTOR_DATA *HardwareC
}
template <typename GfxFamily>
void HardwareCommandsHelper<GfxFamily>::setAdditionalInfo(
INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor,
const Kernel &kernel,
const size_t &sizeCrossThreadData,
const size_t &sizePerThreadData,
const uint32_t threadsPerThreadGroup) {
void HardwareCommandsHelper<GfxFamily>::setGrfInfo(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const Kernel &kernel,
const size_t &sizeCrossThreadData, const size_t &sizePerThreadData) {
auto grfSize = sizeof(typename GfxFamily::GRF);
DEBUG_BREAK_IF((sizeCrossThreadData % grfSize) != 0);
auto numGrfCrossThreadData = static_cast<uint32_t>(sizeCrossThreadData / grfSize);
@ -45,6 +41,9 @@ void HardwareCommandsHelper<GfxFamily>::setAdditionalInfo(
pInterfaceDescriptor->setConstantIndirectUrbEntryReadLength(numGrfPerThreadData);
}
template <typename GfxFamily>
void HardwareCommandsHelper<GfxFamily>::setAdditionalInfo(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const Kernel &kernel, const uint32_t threadsPerThreadGroup) {}
template <typename GfxFamily>
uint32_t HardwareCommandsHelper<GfxFamily>::additionalSizeRequiredDsh() {
return sizeof(INTERFACE_DESCRIPTOR_DATA);