mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Enable L1 cache for Tigerlake
Change-Id: I33513ed084f9d06ceca11315cac03f1b682db535 Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com> Related-To: NEO-4832
This commit is contained in:
committed by
sys_ocldev
parent
ec054a87da
commit
138f04bdcd
@@ -81,7 +81,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(z
|
||||
auto mocs = device->getMOCS(true, false);
|
||||
NEO::EncodeSurfaceState<GfxFamily>::encodeBuffer(surfaceState, debugSurface->getGpuAddress(),
|
||||
debugSurface->getUnderlyingBufferSize(), mocs,
|
||||
false, false, neoDevice->getNumAvailableDevices(),
|
||||
false, false, false, neoDevice->getNumAvailableDevices(),
|
||||
debugSurface, neoDevice->getGmmHelper());
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ struct KernelHw : public KernelImp {
|
||||
auto mocs = this->module->getDevice()->getMOCS(true, false);
|
||||
NEO::Device *neoDevice = module->getDevice()->getNEODevice();
|
||||
NEO::EncodeSurfaceState<GfxFamily>::encodeBuffer(surfaceStateAddress, bufferAddressForSsh, bufferSizeForSsh, mocs,
|
||||
false, false, neoDevice->getNumAvailableDevices(),
|
||||
false, false, false, neoDevice->getNumAvailableDevices(),
|
||||
alloc, neoDevice->getGmmHelper());
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,11 @@ template <typename GfxFamily>
|
||||
void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3, bool alignSizeForAuxTranslation, bool isReadOnlyArgument, const Device &device) {
|
||||
auto rootDeviceIndex = device.getRootDeviceIndex();
|
||||
auto graphicsAllocation = multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex);
|
||||
const auto isReadOnly = isValueSet(getFlags(), CL_MEM_READ_ONLY) || isReadOnlyArgument;
|
||||
EncodeSurfaceState<GfxFamily>::encodeBuffer(memory, getBufferAddress(rootDeviceIndex),
|
||||
getSurfaceSize(alignSizeForAuxTranslation, rootDeviceIndex),
|
||||
getMocsValue(disableL3, isReadOnlyArgument, rootDeviceIndex),
|
||||
true, forceNonAuxMode, device.getNumAvailableDevices(),
|
||||
getMocsValue(disableL3, isReadOnly, rootDeviceIndex),
|
||||
true, forceNonAuxMode, isReadOnly, device.getNumAvailableDevices(),
|
||||
graphicsAllocation, device.getGmmHelper());
|
||||
appendSurfaceStateExt(memory);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ if(TESTS_GEN12LP)
|
||||
set(IGDRCL_SRCS_tests_gen12lp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_tests_gen12lp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/buffer_tests_gen12lp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/coherency_tests_gen12lp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_hw_tests_gen12lp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl
|
||||
|
||||
121
opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl
Normal file
121
opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct BufferTestsTgllp : ::testing::Test {
|
||||
void SetUp() override {
|
||||
context = std::make_unique<MockContext>();
|
||||
device = context->getDevice(0);
|
||||
}
|
||||
|
||||
std::unique_ptr<MockContext> context{};
|
||||
ClDevice *device{};
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
};
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenBufferNotReadonlyWhenProgrammingSurfaceStateThenUseL3) {
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, false, device->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenBufferReadonlyWhenProgrammingSurfaceStateThenUseL1) {
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, true, context->getDevice(0)->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateThenUseL1) {
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, false, context->getDevice(0)->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenL1ForceEnabledWhenProgrammingSurfaceStateThenUseL1) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.ForceL1Caching.set(1);
|
||||
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, false, device->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenBufferReadonlyL1ForceDisabledWhenProgrammingSurfaceStateThenUseL3) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.ForceL1Caching.set(0);
|
||||
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, true, device->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
@@ -26,3 +26,7 @@ HWCMDTEST_EXCLUDE_FAMILY(TimestampEventCreate, givenEventTimestampsWhenQueryKern
|
||||
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_DG1);
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsNotTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_DG1);
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(BufferSetSurfaceTests, givenBufferSetSurfaceThatMemoryIsUnalignedToCachelineButReadOnlyThenL3CacheShouldBeStillOn, IGFX_DG1)
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(BufferSetSurfaceTests, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferPolicy, IGFX_DG1);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/gen12lp/aub_command_stream_receiver_tests_gen12lp.inl"
|
||||
#include "opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl"
|
||||
#include "opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl"
|
||||
#include "opencl/test/unit_test/gen12lp/command_stream_receiver_hw_tests_gen12lp.inl"
|
||||
#include "opencl/test/unit_test/gen12lp/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl"
|
||||
|
||||
@@ -378,3 +378,49 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenGen12WhenCallIsPackedSupportedThenReturn
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
EXPECT_TRUE(helper.packedFormatsSupported());
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(HwHelperTestGen12Lp, whenRequestingMocsThenProperMocsIndicesAreBeingReturned) {
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
auto gmmHelper = this->pDevice->getGmmHelper();
|
||||
|
||||
const auto mocsNoCache = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
||||
const auto mocsL3 = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1;
|
||||
const auto mocsL1 = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST) >> 1;
|
||||
|
||||
EXPECT_EQ(mocsNoCache, helper.getMocsIndex(*gmmHelper, false, false));
|
||||
EXPECT_EQ(mocsNoCache, helper.getMocsIndex(*gmmHelper, false, true));
|
||||
EXPECT_EQ(mocsL3, helper.getMocsIndex(*gmmHelper, true, false));
|
||||
EXPECT_EQ(mocsL1, helper.getMocsIndex(*gmmHelper, true, true));
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(HwHelperTestGen12Lp, givenL1ForceEnabledWhenRequestingMocsThenProperMocsIndicesAreBeingReturned) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.ForceL1Caching.set(1);
|
||||
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
auto gmmHelper = this->pDevice->getGmmHelper();
|
||||
|
||||
const auto mocsNoCache = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
||||
const auto mocsL1 = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST) >> 1;
|
||||
|
||||
EXPECT_EQ(mocsNoCache, helper.getMocsIndex(*gmmHelper, false, false));
|
||||
EXPECT_EQ(mocsNoCache, helper.getMocsIndex(*gmmHelper, false, true));
|
||||
EXPECT_EQ(mocsL1, helper.getMocsIndex(*gmmHelper, true, false));
|
||||
EXPECT_EQ(mocsL1, helper.getMocsIndex(*gmmHelper, true, true));
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(HwHelperTestGen12Lp, givenL1ForceDisabledWhenRequestingMocsThenProperMocsIndicesAreBeingReturned) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.ForceL1Caching.set(0);
|
||||
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
auto gmmHelper = this->pDevice->getGmmHelper();
|
||||
|
||||
const auto mocsNoCache = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
||||
const auto mocsL3 = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1;
|
||||
|
||||
EXPECT_EQ(mocsNoCache, helper.getMocsIndex(*gmmHelper, false, false));
|
||||
EXPECT_EQ(mocsNoCache, helper.getMocsIndex(*gmmHelper, false, true));
|
||||
EXPECT_EQ(mocsL3, helper.getMocsIndex(*gmmHelper, true, false));
|
||||
EXPECT_EQ(mocsL3, helper.getMocsIndex(*gmmHelper, true, true));
|
||||
}
|
||||
|
||||
@@ -26,3 +26,7 @@ HWCMDTEST_EXCLUDE_FAMILY(TimestampEventCreate, givenEventTimestampsWhenQueryKern
|
||||
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_ROCKETLAKE);
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsNotTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_ROCKETLAKE);
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(BufferSetSurfaceTests, givenBufferSetSurfaceThatMemoryIsUnalignedToCachelineButReadOnlyThenL3CacheShouldBeStillOn, IGFX_ROCKETLAKE)
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(BufferSetSurfaceTests, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferPolicy, IGFX_ROCKETLAKE);
|
||||
121
opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp
Normal file
121
opencl/test/unit_test/gen12lp/tgllp/buffer_tests_tgllp.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct BufferTestsTgllp : ::testing::Test {
|
||||
void SetUp() override {
|
||||
context = std::make_unique<MockContext>();
|
||||
device = context->getDevice(0);
|
||||
}
|
||||
|
||||
std::unique_ptr<MockContext> context{};
|
||||
ClDevice *device{};
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
};
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenBufferNotReadonlyWhenProgrammingSurfaceStateThenUseL3) {
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, false, device->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenBufferReadonlyWhenProgrammingSurfaceStateThenUseL1) {
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, true, context->getDevice(0)->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateThenUseL1) {
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, false, context->getDevice(0)->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenL1ForceEnabledWhenProgrammingSurfaceStateThenUseL1) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.ForceL1Caching.set(1);
|
||||
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, false, device->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(BufferTestsTgllp, givenBufferReadonlyL1ForceDisabledWhenProgrammingSurfaceStateThenUseL3) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.ForceL1Caching.set(0);
|
||||
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
context.get(),
|
||||
CL_MEM_READ_WRITE,
|
||||
MemoryConstants::pageSize,
|
||||
nullptr,
|
||||
retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, true, device->getDevice());
|
||||
|
||||
const auto expectedMocs = device->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
}
|
||||
@@ -26,3 +26,7 @@ HWCMDTEST_EXCLUDE_FAMILY(TimestampEventCreate, givenEventTimestampsWhenQueryKern
|
||||
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_TIGERLAKE_LP);
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsNotTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_TIGERLAKE_LP);
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(BufferSetSurfaceTests, givenBufferSetSurfaceThatMemoryIsUnalignedToCachelineButReadOnlyThenL3CacheShouldBeStillOn, IGFX_TIGERLAKE_LP)
|
||||
|
||||
HWCMDTEST_EXCLUDE_FAMILY(BufferSetSurfaceTests, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferPolicy, IGFX_TIGERLAKE_LP);
|
||||
|
||||
@@ -27,6 +27,7 @@ AUBDumpAllocsOnEnqueueReadOnly = 0
|
||||
AUBDumpAllocsOnEnqueueSVMMemcpyOnly = 0
|
||||
AUBDumpForceAllToLocalMemory = 0
|
||||
ForceDeviceId = unk
|
||||
ForceL1Caching = -1
|
||||
SchedulerSimulationReturnInstance = 0
|
||||
SchedulerGWS = 0
|
||||
EnableExperimentalCommandBuffer = 0
|
||||
|
||||
@@ -194,10 +194,10 @@ struct EncodeSurfaceState {
|
||||
using AUXILIARY_SURFACE_MODE = typename R_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
||||
|
||||
static void encodeBuffer(void *dst, uint64_t address, size_t size, uint32_t mocs,
|
||||
bool cpuCoherent, bool forceNonAuxMode, uint32_t numAvailableDevices,
|
||||
bool cpuCoherent, bool forceNonAuxMode, bool isReadOnly, uint32_t numAvailableDevices,
|
||||
GraphicsAllocation *allocation, GmmHelper *gmmHelper);
|
||||
static void encodeExtraBufferParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation, GmmHelper *gmmHelper,
|
||||
uint32_t numAvailableDevices);
|
||||
bool isReadOnly, uint32_t numAvailableDevices);
|
||||
|
||||
static constexpr uintptr_t getSurfaceBaseAddressAlignmentMask() {
|
||||
return ~(getSurfaceBaseAddressAlignment() - 1);
|
||||
|
||||
@@ -267,7 +267,7 @@ void EncodeStoreMMIO<Family>::encode(LinearStream &csr, uint32_t offset, uint64_
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::encodeBuffer(void *dst, uint64_t address, size_t size, uint32_t mocs,
|
||||
bool cpuCoherent, bool forceNonAuxMode, uint32_t numAvailableDevices,
|
||||
bool cpuCoherent, bool forceNonAuxMode, bool isReadOnly, uint32_t numAvailableDevices,
|
||||
GraphicsAllocation *allocation, GmmHelper *gmmHelper) {
|
||||
auto surfaceState = reinterpret_cast<R_SURFACE_STATE *>(dst);
|
||||
UNRECOVERABLE_IF(!isAligned<getSurfaceBaseAddressAlignment()>(size));
|
||||
@@ -306,7 +306,7 @@ void EncodeSurfaceState<Family>::encodeBuffer(void *dst, uint64_t address, size_
|
||||
surfaceState->setMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED));
|
||||
}
|
||||
|
||||
EncodeSurfaceState<Family>::encodeExtraBufferParams(surfaceState, allocation, gmmHelper, numAvailableDevices);
|
||||
EncodeSurfaceState<Family>::encodeExtraBufferParams(surfaceState, allocation, gmmHelper, isReadOnly, numAvailableDevices);
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
|
||||
@@ -391,7 +391,7 @@ inline size_t EncodeWA<GfxFamily>::getAdditionalPipelineSelectSize(Device &devic
|
||||
|
||||
template <typename GfxFamily>
|
||||
void EncodeSurfaceState<GfxFamily>::encodeExtraBufferParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation, GmmHelper *gmmHelper,
|
||||
uint32_t numAvailableDevices) {
|
||||
bool isReadOnly, uint32_t numAvailableDevices) {
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -55,6 +55,7 @@ DECLARE_DEBUG_VARIABLE(bool, ZebinAppendElws, false, "Append crossthread data wi
|
||||
DECLARE_DEBUG_VARIABLE(bool, ZebinIgnoreIcbeVersion, false, "Ignore IGC\'s ICBE version")
|
||||
DECLARE_DEBUG_VARIABLE(bool, UseExternalAllocatorForSshAndDsh, false, "Use 32 bit external Allocator for ssh and dsh in Level Zero")
|
||||
DECLARE_DEBUG_VARIABLE(std::string, ForceDeviceId, std::string("unk"), "DeviceId selected for testing")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ForceL1Caching, -1, "-1: default, 0: disable, 1: enable, When set to true driver will program L1 cache policy for surface state and stateless accessess")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ForceAuxTranslationEnabled, -1, "-1: default, 0: disabled, 1: enabled")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, SchedulerSimulationReturnInstance, 0, "prints execution model related debug information")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, SchedulerGWS, 0, "Forces gws of scheduler kernel, only multiple of 24 allowed or 0 - default selected")
|
||||
|
||||
@@ -47,6 +47,24 @@ void EncodeWA<Family>::encodeAdditionalPipelineSelect(Device &device, LinearStre
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::encodeExtraBufferParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation, GmmHelper *gmmHelper,
|
||||
bool isReadOnly, uint32_t numAvailableDevices) {
|
||||
const bool isL3Allowed = surfaceState->getMemoryObjectControlState() == gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
|
||||
if (isL3Allowed) {
|
||||
const bool isConstantSurface = allocation && allocation->getAllocationType() == GraphicsAllocation::AllocationType::CONSTANT_SURFACE;
|
||||
bool useL1 = isReadOnly || isConstantSurface;
|
||||
|
||||
if (DebugManager.flags.ForceL1Caching.get() != -1) {
|
||||
useL1 = !!DebugManager.flags.ForceL1Caching.get();
|
||||
}
|
||||
|
||||
if (useL1) {
|
||||
surfaceState->setMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template struct EncodeDispatchKernel<Family>;
|
||||
template struct EncodeStates<Family>;
|
||||
template struct EncodeMath<Family>;
|
||||
|
||||
@@ -240,6 +240,23 @@ bool HwHelperHw<Family>::useOnlyGlobalTimestamps() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t HwHelperHw<Family>::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const {
|
||||
if (l3enabled) {
|
||||
if (DebugManager.flags.ForceL1Caching.get() != -1) {
|
||||
l1enabled = !!DebugManager.flags.ForceL1Caching.get();
|
||||
}
|
||||
|
||||
if (l1enabled) {
|
||||
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST) >> 1;
|
||||
} else {
|
||||
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1;
|
||||
}
|
||||
}
|
||||
|
||||
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
||||
}
|
||||
|
||||
template class HwHelperHw<Family>;
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
template struct MemorySynchronizationCommands<Family>;
|
||||
|
||||
@@ -47,7 +47,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenAllocationPr
|
||||
length.Length = static_cast<uint32_t>(allocSize - 1);
|
||||
GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1);
|
||||
EncodeSurfaceState<FamilyType>::encodeBuffer(stateBuffer, gpuAddr, allocSize, 1,
|
||||
false, false, 1u,
|
||||
false, false, false, 1u,
|
||||
&allocation, pDevice->getGmmHelper());
|
||||
EXPECT_EQ(length.SurfaceState.Depth + 1u, state->getDepth());
|
||||
EXPECT_EQ(length.SurfaceState.Width + 1u, state->getWidth());
|
||||
@@ -74,7 +74,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenAllocationNo
|
||||
length.Length = static_cast<uint32_t>(allocSize - 1);
|
||||
|
||||
EncodeSurfaceState<FamilyType>::encodeBuffer(stateBuffer, gpuAddr, allocSize, 1,
|
||||
true, false, 1u,
|
||||
true, false, false, 1u,
|
||||
nullptr, pDevice->getGmmHelper());
|
||||
|
||||
EXPECT_EQ(RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_NULL, state->getSurfaceType());
|
||||
@@ -100,7 +100,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenGpuCoherency
|
||||
length.Length = static_cast<uint32_t>(allocSize - 1);
|
||||
|
||||
EncodeSurfaceState<FamilyType>::encodeBuffer(stateBuffer, gpuAddr, allocSize, 1,
|
||||
false, false, 1u,
|
||||
false, false, false, 1u,
|
||||
nullptr, pDevice->getGmmHelper());
|
||||
|
||||
EXPECT_EQ(RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT, state->getCoherencyType());
|
||||
|
||||
Reference in New Issue
Block a user