mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 22:08:53 +08:00
Extend kernel commands helper
add method to check if we should program binding table prefetch Change-Id: I2a78f406b6f2a3fde33dec653ec887b7f2c03442 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -1,4 +1,4 @@
|
||||
#!groovy
|
||||
neoDependenciesRev='798076-1088'
|
||||
strategy='EQUAL'
|
||||
allowedCD=270
|
||||
allowedCD=271
|
||||
|
||||
@@ -164,5 +164,7 @@ struct KernelCommandsHelper : public PerThreadDataHelper {
|
||||
|
||||
static const size_t alignInterfaceDescriptorData = 64 * sizeof(uint8_t);
|
||||
static const uint32_t alignIndirectStatePointer = 64 * sizeof(uint8_t);
|
||||
|
||||
static bool doBindingTablePrefetch();
|
||||
};
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -388,7 +388,7 @@ size_t KernelCommandsHelper<GfxFamily>::sendIndirectState(
|
||||
DEBUG_BREAK_IF(patchInfo.executionEnvironment == nullptr);
|
||||
|
||||
auto bindingTablePrefetchSize = std::min(31u, static_cast<uint32_t>(kernel.getNumberOfBindingTableStates()));
|
||||
if (kernel.isSchedulerKernel) {
|
||||
if (kernel.isSchedulerKernel || !KernelCommandsHelper<GfxFamily>::doBindingTablePrefetch()) {
|
||||
bindingTablePrefetchSize = 0;
|
||||
}
|
||||
|
||||
@@ -431,4 +431,9 @@ void KernelCommandsHelper<GfxFamily>::programMiSemaphoreWait(LinearStream &comma
|
||||
miSemaphoreCmd->setSemaphoreDataDword(compareData);
|
||||
miSemaphoreCmd->setSemaphoreGraphicsAddress(compareAddress);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool KernelCommandsHelper<GfxFamily>::doBindingTablePrefetch() {
|
||||
return true;
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "runtime/helpers/kernel_commands.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/mocks/mock_kernel.h"
|
||||
#include "test.h"
|
||||
@@ -32,3 +33,7 @@ GEN10TEST_F(Gen10KernelTest, givenKernelWhenCanTransformImagesIsCalledThenReturn
|
||||
auto retVal = mockKernel.mockKernel->Kernel::canTransformImages();
|
||||
EXPECT_TRUE(retVal);
|
||||
}
|
||||
using Gen10KernelCommandsTest = testing::Test;
|
||||
GEN10TEST_F(Gen10KernelCommandsTest, givenGen10PlatformWhenDoBindingTablePrefetchIsCalledThenReturnsTrue) {
|
||||
EXPECT_TRUE(KernelCommandsHelper<FamilyType>::doBindingTablePrefetch());
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "runtime/helpers/kernel_commands.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/mocks/mock_kernel.h"
|
||||
#include "test.h"
|
||||
@@ -32,3 +33,7 @@ GEN8TEST_F(Gen8KernelTest, givenKernelWhenCanTransformImagesIsCalledThenReturnsF
|
||||
auto retVal = mockKernel.mockKernel->Kernel::canTransformImages();
|
||||
EXPECT_FALSE(retVal);
|
||||
}
|
||||
using Gen8KernelCommandsTest = testing::Test;
|
||||
GEN8TEST_F(Gen8KernelCommandsTest, givenGen8PlatformWhenDoBindingTablePrefetchIsCalledThenReturnsTrue) {
|
||||
EXPECT_TRUE(KernelCommandsHelper<FamilyType>::doBindingTablePrefetch());
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "runtime/helpers/kernel_commands.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/mocks/mock_kernel.h"
|
||||
#include "test.h"
|
||||
@@ -32,3 +33,7 @@ GEN9TEST_F(Gen9KernelTest, givenKernelWhenCanTransformImagesIsCalledThenReturnsT
|
||||
auto retVal = mockKernel.mockKernel->Kernel::canTransformImages();
|
||||
EXPECT_TRUE(retVal);
|
||||
}
|
||||
using Gen9KernelCommandsTest = testing::Test;
|
||||
GEN9TEST_F(Gen9KernelCommandsTest, givenGen9PlatformWhenDoBindingTablePrefetchIsCalledThenReturnsTrue) {
|
||||
EXPECT_TRUE(KernelCommandsHelper<FamilyType>::doBindingTablePrefetch());
|
||||
}
|
||||
|
||||
@@ -382,7 +382,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, KernelCommandsTest, givenKernelWithFourBindingTableE
|
||||
nullptr);
|
||||
|
||||
auto interfaceDescriptor = reinterpret_cast<INTERFACE_DESCRIPTOR_DATA *>(dsh.getCpuBase());
|
||||
EXPECT_EQ(expectedBindingTableCount, interfaceDescriptor->getBindingTableEntryCount());
|
||||
if (KernelCommandsHelper<FamilyType>::doBindingTablePrefetch()) {
|
||||
EXPECT_EQ(expectedBindingTableCount, interfaceDescriptor->getBindingTableEntryCount());
|
||||
} else {
|
||||
EXPECT_EQ(0u, interfaceDescriptor->getBindingTableEntryCount());
|
||||
}
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, KernelCommandsTest, givenKernelThatIsSchedulerWhenIndirectStateIsEmittedThenInterfaceDescriptorContainsZeroBindingTableEntryCount) {
|
||||
@@ -452,7 +456,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, KernelCommandsTest, givenKernelWith100BindingTableEn
|
||||
nullptr);
|
||||
|
||||
auto interfaceDescriptor = reinterpret_cast<INTERFACE_DESCRIPTOR_DATA *>(dsh.getCpuBase());
|
||||
EXPECT_EQ(31u, interfaceDescriptor->getBindingTableEntryCount());
|
||||
if (KernelCommandsHelper<FamilyType>::doBindingTablePrefetch()) {
|
||||
EXPECT_EQ(31u, interfaceDescriptor->getBindingTableEntryCount());
|
||||
} else {
|
||||
EXPECT_EQ(0u, interfaceDescriptor->getBindingTableEntryCount());
|
||||
}
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, KernelCommandsTest, whenSendingIndirectStateThenKernelsWalkOrderIsTakenIntoAccount) {
|
||||
|
||||
Reference in New Issue
Block a user