Add memory backed buffer allocation for L0 ray tracing.
This allocates the buffer on a per-device basis and enables ray tracing on devices that support it when given a kernel with ray tracing calls. Signed-off-by: Jim Snow <jim.m.snow@intel.com>
This commit is contained in:
parent
135ac74c2c
commit
2acc0fb3f6
|
@ -12,6 +12,7 @@
|
|||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/helpers/register_offsets.h"
|
||||
#include "shared/source/helpers/simd_helper.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/memory_manager/residency_container.h"
|
||||
#include "shared/source/unified_memory/unified_memory.h"
|
||||
|
|
|
@ -214,6 +214,16 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(z
|
|||
}
|
||||
}
|
||||
|
||||
if (kernelImp->usesRayTracing()) {
|
||||
NEO::GraphicsAllocation *memoryBackedBuffer = device->getNEODevice()->getRTMemoryBackedBuffer();
|
||||
if (memoryBackedBuffer == nullptr) {
|
||||
return ZE_RESULT_ERROR_UNINITIALIZED;
|
||||
} else {
|
||||
NEO::LinearStream *linearStream = commandContainer.getCommandStream();
|
||||
NEO::EncodeEnableRayTracing<GfxFamily>::programEnableRayTracing(*linearStream, *memoryBackedBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -807,6 +807,11 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
|
|||
kernelImmData->getDescriptor().kernelAttributes.hasNonKernelArgStore ||
|
||||
kernelImmData->getDescriptor().kernelAttributes.hasNonKernelArgAtomic;
|
||||
|
||||
if (this->usesRayTracing()) {
|
||||
neoDevice->initializeRayTracing();
|
||||
this->residencyContainer.push_back(neoDevice->getRTMemoryBackedBuffer());
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -127,6 +127,9 @@ struct KernelImp : Kernel {
|
|||
uint32_t patchGlobalOffset() override;
|
||||
|
||||
ze_result_t setCacheConfig(ze_cache_config_flags_t flags) override;
|
||||
bool usesRayTracing() {
|
||||
return kernelImmData->getDescriptor().hasRTCalls();
|
||||
}
|
||||
|
||||
ze_result_t getProfileInfo(zet_profile_properties_t *pProfileProperties) override {
|
||||
pProfileProperties->flags = 0;
|
||||
|
|
|
@ -84,6 +84,8 @@ struct ModuleImmutableDataFixture : public DeviceFixture {
|
|||
};
|
||||
|
||||
struct MockModule : public L0::ModuleImp {
|
||||
using ModuleImp::getKernelImmutableDataVector;
|
||||
using ModuleImp::maxGroupSize;
|
||||
using ModuleImp::translationUnit;
|
||||
using ModuleImp::type;
|
||||
MockModule(L0::Device *device,
|
||||
|
|
|
@ -570,6 +570,86 @@ HWTEST_F(KernelImmutableDataTests, givenKernelInitializedWithPrivateMemoryThenCo
|
|||
EXPECT_EQ(sizeContainerWithoutPrivateMemory + 1u, sizeContainerWithPrivateMemory);
|
||||
}
|
||||
|
||||
class KernelDescriptorRTCallsTrue : public NEO::KernelDescriptor {
|
||||
bool hasRTCalls() const override {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class KernelDescriptorRTCallsFalse : public NEO::KernelDescriptor {
|
||||
bool hasRTCalls() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(KernelImmutableDataTests, whenHasRTCallsIsTrueThenRayTracingIsInitialized) {
|
||||
KernelDescriptorRTCallsTrue mockDescriptor = {};
|
||||
mockDescriptor.kernelMetadata.kernelName = "rt_test";
|
||||
for (auto i = 0u; i < 3u; i++) {
|
||||
mockDescriptor.kernelAttributes.requiredWorkgroupSize[i] = 0;
|
||||
}
|
||||
|
||||
std::unique_ptr<MockImmutableData> mockKernelImmutableData =
|
||||
std::make_unique<MockImmutableData>(32u);
|
||||
mockKernelImmutableData->kernelDescriptor = &mockDescriptor;
|
||||
|
||||
ModuleBuildLog *moduleBuildLog = nullptr;
|
||||
module = std::make_unique<MockModule>(device,
|
||||
moduleBuildLog,
|
||||
ModuleType::User,
|
||||
32u,
|
||||
mockKernelImmutableData.get());
|
||||
module->maxGroupSize = 10;
|
||||
|
||||
std::unique_ptr<ModuleImmutableDataFixture::MockKernel> kernel;
|
||||
kernel = std::make_unique<ModuleImmutableDataFixture::MockKernel>(module.get());
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
kernelDesc.pKernelName = "rt_test";
|
||||
|
||||
auto immDataVector =
|
||||
const_cast<std::vector<std::unique_ptr<KernelImmutableData>> *>(&module.get()->getKernelImmutableDataVector());
|
||||
|
||||
immDataVector->push_back(std::move(mockKernelImmutableData));
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, kernel->initialize(&kernelDesc));
|
||||
EXPECT_NE(nullptr, module.get()->getDevice()->getNEODevice()->getRTMemoryBackedBuffer());
|
||||
}
|
||||
|
||||
TEST_F(KernelImmutableDataTests, whenHasRTCallsIsFalseThenRayTracingIsNotInitialized) {
|
||||
KernelDescriptorRTCallsFalse mockDescriptor = {};
|
||||
mockDescriptor.kernelMetadata.kernelName = "rt_test";
|
||||
for (auto i = 0u; i < 3u; i++) {
|
||||
mockDescriptor.kernelAttributes.requiredWorkgroupSize[i] = 0;
|
||||
}
|
||||
|
||||
std::unique_ptr<MockImmutableData> mockKernelImmutableData =
|
||||
std::make_unique<MockImmutableData>(32u);
|
||||
mockKernelImmutableData->kernelDescriptor = &mockDescriptor;
|
||||
|
||||
ModuleBuildLog *moduleBuildLog = nullptr;
|
||||
module = std::make_unique<MockModule>(device,
|
||||
moduleBuildLog,
|
||||
ModuleType::User,
|
||||
32u,
|
||||
mockKernelImmutableData.get());
|
||||
module->maxGroupSize = 10;
|
||||
|
||||
std::unique_ptr<ModuleImmutableDataFixture::MockKernel> kernel;
|
||||
kernel = std::make_unique<ModuleImmutableDataFixture::MockKernel>(module.get());
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
kernelDesc.pKernelName = "rt_test";
|
||||
|
||||
auto immDataVector =
|
||||
const_cast<std::vector<std::unique_ptr<KernelImmutableData>> *>(&module.get()->getKernelImmutableDataVector());
|
||||
|
||||
immDataVector->push_back(std::move(mockKernelImmutableData));
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, kernel->initialize(&kernelDesc));
|
||||
EXPECT_EQ(nullptr, module.get()->getDevice()->getNEODevice()->getRTMemoryBackedBuffer());
|
||||
}
|
||||
|
||||
using KernelIndirectPropertiesFromIGCTests = KernelImmutableDataTests;
|
||||
|
||||
HWTEST_F(KernelIndirectPropertiesFromIGCTests, whenInitializingKernelWithNoKernelLoadAndNoStoreAndNoAtomicThenHasIndirectAccessIsSetToFalse) {
|
||||
|
@ -847,6 +927,28 @@ HWTEST_F(KernelPropertiesTests, givenValidKernelWithIndirectAccessFlagsAndDisabl
|
|||
EXPECT_TRUE(unifiedMemoryControls.indirectSharedAllocationsAllowed);
|
||||
}
|
||||
|
||||
HWTEST2_F(KernelPropertiesTests, whenHasRTCallsIsTrueThenUsesRayTracingIsTrue, MatchAny) {
|
||||
WhiteBoxKernelHw<gfxCoreFamily> mockKernel;
|
||||
KernelDescriptorRTCallsTrue mockDescriptor = {};
|
||||
WhiteBox<::L0::KernelImmutableData> mockKernelImmutableData = {};
|
||||
|
||||
mockKernelImmutableData.kernelDescriptor = &mockDescriptor;
|
||||
mockKernel.kernelImmData = &mockKernelImmutableData;
|
||||
|
||||
EXPECT_TRUE(mockKernel.usesRayTracing());
|
||||
}
|
||||
|
||||
HWTEST2_F(KernelPropertiesTests, whenHasRTCallsIsFalseThenUsesRayTracingIsFalse, MatchAny) {
|
||||
WhiteBoxKernelHw<gfxCoreFamily> mockKernel;
|
||||
KernelDescriptorRTCallsFalse mockDescriptor = {};
|
||||
WhiteBox<::L0::KernelImmutableData> mockKernelImmutableData = {};
|
||||
|
||||
mockKernelImmutableData.kernelDescriptor = &mockDescriptor;
|
||||
mockKernel.kernelImmData = &mockKernelImmutableData;
|
||||
|
||||
EXPECT_FALSE(mockKernel.usesRayTracing());
|
||||
}
|
||||
|
||||
using KernelIndirectPropertiesTests = KernelPropertiesTests;
|
||||
|
||||
HWTEST_F(KernelIndirectPropertiesTests, whenCallingSetIndirectAccessWithKernelThatHasIndirectAccessThenIndirectAccessIsSet) {
|
||||
|
@ -1314,6 +1416,7 @@ struct MyMockKernel : public Mock<Kernel> {
|
|||
}
|
||||
bool setSurfaceStateCalled = false;
|
||||
};
|
||||
|
||||
TEST_F(KernelImpPatchBindlessTest, GivenValidBindlessOffsetWhenSetArgBufferWithAllocThensetBufferSurfaceStateCalled) {
|
||||
ze_kernel_desc_t desc = {};
|
||||
desc.pKernelName = kernelName.c_str();
|
||||
|
|
|
@ -747,3 +747,11 @@ TEST(ClDeviceHelperTest, givenZeroNumberOfTilesWhenPrepareDeviceEnvironmentsCoun
|
|||
uint32_t devicesCount = HwHelper::getSubDevicesCount(&hwInfo);
|
||||
EXPECT_EQ(devicesCount, 1u);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, whenInitializeRayTracingIsCalledAndRtBackedBufferIsNullptrMemoryBackedBufferIsCreated) {
|
||||
EXPECT_EQ(nullptr, pDevice->getRTMemoryBackedBuffer());
|
||||
pDevice->initializeRayTracing();
|
||||
EXPECT_NE(nullptr, pDevice->getRTMemoryBackedBuffer());
|
||||
pDevice->initializeRayTracing();
|
||||
EXPECT_NE(nullptr, pDevice->getRTMemoryBackedBuffer());
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ set(IGDRCL_SRCS_tests_helpers
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/per_thread_data_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/queue_helpers_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/raii_hw_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ray_tracing_helper_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sampler_helpers_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/task_information_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/timestamp_packet_1_tests.cpp
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/ray_tracing_helper.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(RayTracingHelperTests, whenMemoryBackedFifoSizeIsRequestedThenCorrectValueIsReturned) {
|
||||
MockDevice device;
|
||||
|
||||
size_t size = RayTracingHelper::getTotalMemoryBackedFifoSize(device);
|
||||
size_t expectedSize = device.getHardwareInfo().gtSystemInfo.DualSubSliceCount * RayTracingHelper::memoryBackedFifoSizePerDss;
|
||||
EXPECT_EQ(expectedSize, size);
|
||||
}
|
|
@ -33,6 +33,8 @@ set(CLOC_LIB_SRCS_LIB
|
|||
${NEO_SHARED_DIRECTORY}/helpers/hw_info.cpp
|
||||
${NEO_SHARED_DIRECTORY}/helpers/hw_info.h
|
||||
${NEO_SHARED_DIRECTORY}/helpers${BRANCH_DIR_SUFFIX}/hw_info_extended.cpp
|
||||
${NEO_SHARED_DIRECTORY}/kernel${BRANCH_DIR_SUFFIX}/kernel_descriptor.cpp
|
||||
${NEO_SHARED_DIRECTORY}/kernel${BRANCH_DIR_SUFFIX}/kernel_descriptor.h
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/os_library.h
|
||||
${NEO_SOURCE_DIR}/opencl/source/platform/extensions.cpp
|
||||
${NEO_SOURCE_DIR}/opencl/source/platform/extensions.h
|
||||
|
|
|
@ -19,6 +19,7 @@ set(NEO_CORE_COMMAND_CONTAINER
|
|||
|
||||
if(SUPPORT_XEHP_PLUS)
|
||||
list(APPEND NEO_CORE_COMMAND_CONTAINER
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_raytracing_xehp_plus.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_xehp_plus.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/implicit_scaling_xehp_plus.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/walker_partition_xehp_plus.h
|
||||
|
|
|
@ -370,4 +370,10 @@ struct EncodeMiArbCheck {
|
|||
static void program(LinearStream &commandStream);
|
||||
static size_t getCommandSize();
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct EncodeEnableRayTracing {
|
||||
static void programEnableRayTracing(LinearStream &commandStream, GraphicsAllocation &backBuffer);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -442,4 +442,8 @@ void EncodeSempahore<Family>::programMiSemaphoreWait(MI_SEMAPHORE_WAIT *cmd,
|
|||
*cmd = localCmd;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void EncodeEnableRayTracing<GfxFamily>::programEnableRayTracing(LinearStream &commandStream, GraphicsAllocation &backBuffer) {
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include "hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <typename GfxFamily>
|
||||
void EncodeEnableRayTracing<GfxFamily>::programEnableRayTracing(LinearStream &commandStream, GraphicsAllocation &backBuffer) {
|
||||
}
|
||||
|
||||
} // namespace NEO
|
|
@ -20,6 +20,7 @@
|
|||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/pipeline_select_helper.h"
|
||||
#include "shared/source/helpers/ray_tracing_helper.h"
|
||||
#include "shared/source/helpers/simd_helper.h"
|
||||
#include "shared/source/helpers/state_base_address.h"
|
||||
#include "shared/source/kernel/dispatch_kernel_encoder_interface.h"
|
||||
|
|
|
@ -937,10 +937,6 @@ template <typename GfxFamily>
|
|||
void CommandStreamReceiverHw<GfxFamily>::programMediaSampler(LinearStream &commandStream, DispatchFlags &dispatchFlags) {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandStreamReceiverHw<GfxFamily>::programPerDssBackedBuffer(LinearStream &commandStream, Device &device, DispatchFlags &dispatchFlags) {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForMediaSampler(bool mediaSamplerRequired) const {
|
||||
return 0;
|
||||
|
@ -1389,11 +1385,6 @@ inline bool CommandStreamReceiverHw<GfxFamily>::initDirectSubmission(Device &dev
|
|||
return ret;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPerDssBackedBuffer(const HardwareInfo &hwInfo) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
TagAllocatorBase *CommandStreamReceiverHw<GfxFamily>::getTimestampPacketAllocator() {
|
||||
if (timestampPacketAllocator.get() == nullptr) {
|
||||
|
|
|
@ -109,4 +109,13 @@ GraphicsAllocation *CommandStreamReceiverHw<GfxFamily>::getClearColorAllocation(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandStreamReceiverHw<GfxFamily>::programPerDssBackedBuffer(LinearStream &commandStream, Device &device, DispatchFlags &dispatchFlags) {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPerDssBackedBuffer(const HardwareInfo &hwInfo) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/ray_tracing_helper.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/os_interface/driver_info.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
|
@ -34,6 +35,9 @@ Device::Device(ExecutionEnvironment *executionEnvironment)
|
|||
}
|
||||
|
||||
Device::~Device() {
|
||||
getMemoryManager()->freeGraphicsMemory(rtMemoryBackedBuffer);
|
||||
rtMemoryBackedBuffer = nullptr;
|
||||
|
||||
DEBUG_BREAK_IF(nullptr == executionEnvironment->memoryManager.get());
|
||||
|
||||
if (performanceCounters) {
|
||||
|
@ -543,4 +547,10 @@ const std::vector<EngineControl> &Device::getEngines() const {
|
|||
return this->engines;
|
||||
}
|
||||
|
||||
void Device::initializeRayTracing() {
|
||||
if (rtMemoryBackedBuffer == nullptr) {
|
||||
auto size = RayTracingHelper::getTotalMemoryBackedFifoSize(*this);
|
||||
rtMemoryBackedBuffer = getMemoryManager()->allocateGraphicsMemoryWithProperties({getRootDeviceIndex(), size, GraphicsAllocation::AllocationType::BUFFER, getDeviceBitfield()});
|
||||
}
|
||||
}
|
||||
} // namespace NEO
|
||||
|
|
|
@ -111,6 +111,8 @@ class Device : public ReferenceTrackedObject<Device> {
|
|||
|
||||
static decltype(&PerformanceCounters::create) createPerformanceCountersFunc;
|
||||
std::unique_ptr<SyncBufferHandler> syncBufferHandler;
|
||||
GraphicsAllocation *getRTMemoryBackedBuffer() { return rtMemoryBackedBuffer; }
|
||||
void initializeRayTracing();
|
||||
|
||||
protected:
|
||||
Device() = delete;
|
||||
|
@ -169,6 +171,9 @@ class Device : public ReferenceTrackedObject<Device> {
|
|||
DeviceBitfield deviceBitfield = 1;
|
||||
|
||||
uintptr_t specializedDevice = reinterpret_cast<uintptr_t>(nullptr);
|
||||
|
||||
GraphicsAllocation *rtMemoryBackedBuffer = nullptr;
|
||||
GraphicsAllocation *rtDispatchGlobals = nullptr;
|
||||
};
|
||||
|
||||
inline EngineControl &Device::getDefaultEngine() {
|
||||
|
|
|
@ -57,4 +57,5 @@ template struct EncodeMemoryPrefetch<Family>;
|
|||
template struct EncodeWA<Family>;
|
||||
template struct EncodeMiArbCheck<Family>;
|
||||
template struct EncodeComputeMode<Family>;
|
||||
template struct EncodeEnableRayTracing<Family>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -112,4 +112,5 @@ template struct EncodeWA<Family>;
|
|||
template struct EncodeMemoryPrefetch<Family>;
|
||||
template struct EncodeMiArbCheck<Family>;
|
||||
template struct EncodeComputeMode<Family>;
|
||||
template struct EncodeEnableRayTracing<Family>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -51,4 +51,5 @@ template struct EncodeMemoryPrefetch<Family>;
|
|||
template struct EncodeWA<Family>;
|
||||
template struct EncodeMiArbCheck<Family>;
|
||||
template struct EncodeComputeMode<Family>;
|
||||
template struct EncodeEnableRayTracing<Family>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -51,4 +51,5 @@ template struct EncodeMemoryPrefetch<Family>;
|
|||
template struct EncodeWA<Family>;
|
||||
template struct EncodeMiArbCheck<Family>;
|
||||
template struct EncodeComputeMode<Family>;
|
||||
template struct EncodeEnableRayTracing<Family>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -88,6 +88,8 @@ set(NEO_CORE_HELPERS
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/preamble_bdw_plus.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ptr_math.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ray_tracing_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ray_tracing_helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/register_offsets.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/registered_method_dispatcher.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/simd_helper.h
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (C) 2016-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/ray_tracing_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
const uint32_t RayTracingHelper::memoryBackedFifoSizePerDss = 0;
|
||||
|
||||
size_t RayTracingHelper::getTotalMemoryBackedFifoSize(const Device &device) {
|
||||
return 0;
|
||||
}
|
||||
size_t RayTracingHelper::getMemoryBackedFifoSizeToPatch() {
|
||||
return 0;
|
||||
}
|
||||
} // namespace NEO
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (C) 2016-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/basic_math.h"
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
|
||||
#include <cstdint>
|
||||
namespace NEO {
|
||||
class RayTracingHelper : public NonCopyableOrMovableClass {
|
||||
public:
|
||||
static const uint32_t memoryBackedFifoSizePerDss;
|
||||
|
||||
static size_t getTotalMemoryBackedFifoSize(const Device &device);
|
||||
static size_t getMemoryBackedFifoSizeToPatch();
|
||||
};
|
||||
} // namespace NEO
|
|
@ -13,7 +13,7 @@ set(NEO_CORE_KERNEL
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_descriptor_extended_device_side_enqueue.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_descriptor_extended_vme.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_metadata.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/kernel_descriptor.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor_from_patchtokens.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor_from_patchtokens.h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -8,4 +8,7 @@
|
|||
#include "shared/source/kernel/kernel_descriptor.h"
|
||||
|
||||
namespace NEO {
|
||||
bool KernelDescriptor::hasRTCalls() const {
|
||||
return false;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
|
|
@ -31,7 +31,7 @@ struct ExtendedInfoBase {
|
|||
virtual bool specialPipelineSelectModeRequired() const { return false; }
|
||||
};
|
||||
|
||||
struct KernelDescriptor final {
|
||||
struct KernelDescriptor {
|
||||
enum AddressingMode : uint8_t {
|
||||
AddrNone,
|
||||
Stateless,
|
||||
|
@ -42,7 +42,8 @@ struct KernelDescriptor final {
|
|||
};
|
||||
|
||||
KernelDescriptor() = default;
|
||||
~KernelDescriptor() = default;
|
||||
virtual ~KernelDescriptor() = default;
|
||||
virtual bool hasRTCalls() const;
|
||||
|
||||
struct KernelAttributes {
|
||||
KernelAttributes() { flags.packed = 0U; }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_container/command_encoder.inl"
|
||||
#include "shared/source/command_container/command_encoder_raytracing_xehp_plus.inl"
|
||||
#include "shared/source/command_container/command_encoder_xehp_plus.inl"
|
||||
#include "shared/source/command_container/encode_compute_mode_tgllp_plus.inl"
|
||||
#include "shared/source/command_container/implicit_scaling.h"
|
||||
|
@ -73,4 +74,5 @@ template struct EncodeMemoryPrefetch<Family>;
|
|||
template struct EncodeMiArbCheck<Family>;
|
||||
template struct EncodeWA<Family>;
|
||||
template struct ImplicitScalingDispatch<Family>;
|
||||
template struct EncodeEnableRayTracing<Family>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -60,6 +60,7 @@ class MockDevice : public RootDevice {
|
|||
using Device::getGlobalMemorySize;
|
||||
using Device::initializeCaps;
|
||||
using Device::isDebuggerActive;
|
||||
using Device::rtMemoryBackedBuffer;
|
||||
using RootDevice::createEngines;
|
||||
using RootDevice::defaultEngineIndex;
|
||||
using RootDevice::getDeviceBitfield;
|
||||
|
|
|
@ -9,6 +9,7 @@ target_sources(${TARGET_NAME} PRIVATE
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_atomic.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_command_buffer.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dispatch_kernel.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_enable_raytracing.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_math.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_media_interface_descriptor.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_mi_flush_dw.cpp
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/common/fixtures/command_container_fixture.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeEnableRayTracing = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
HWTEST_F(CommandEncodeEnableRayTracing, programEnableRayTracing) {
|
||||
uint32_t pCmdBuffer[1024];
|
||||
uint32_t pMemoryBackedBuffer[1024];
|
||||
|
||||
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
|
||||
LinearStream stream(&gfxAllocation);
|
||||
|
||||
MockGraphicsAllocation memoryBackedBuffer(static_cast<void *>(pMemoryBackedBuffer), sizeof(pMemoryBackedBuffer));
|
||||
|
||||
EncodeEnableRayTracing<FamilyType>::programEnableRayTracing(stream, memoryBackedBuffer);
|
||||
}
|
Loading…
Reference in New Issue