UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NeuralProfile.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6#include "UObject/Object.h"
7#include "Misc/Guid.h"
8#include "NeuralProfile.generated.h"
9
10#define MAX_NEURAL_PROFILE_COUNT 64
11
12
13UENUM(BlueprintType)
15{
16 Type32 UMETA(DisplayName = "32bit"),
17 Type16 UMETA(DisplayName = "16bit"),
18};
19
20UENUM(BlueprintType)
22{
25 OneByOne UMETA(DisplayName = "1x1"),
26
27 TwoByTwo UMETA(DisplayName = "2x2"),
28
29 FourByFour UMETA(DisplayName = "4x4"),
30
31 EightByEight UMETA(DisplayName = "8x8"),
32
37 Auto UMETA(DisplayName = "Auto")
38};
39
40UENUM(BlueprintType)
42{
44 Ignore UMETA(DisplayName = "Ignore"),
45
47 Feathering UMETA(DisplayName = "Feathering")
48};
49
50
51UENUM(BlueprintType)
53{
54 NNERuntimeORTDml UMETA(DisplayName = "NNERuntimeORTDml"),
55
57 NNERuntimeRDGHlsl UMETA(DisplayName = "NNERuntimeRDGHlsl"),
58
60};
61
62// struct with all the settings we want in UNeuralProfile, separate to make it easer to pass this data around in the engine.
63USTRUCT(BlueprintType)
65{
67
68
72 UPROPERTY(Category = "Common", EditAnywhere, BlueprintReadOnly, meta=(DisplayName="Input Format", editcondition = "false", EditConditionHides))
74
79 UPROPERTY(Category = "Common", EditAnywhere, BlueprintReadOnly, meta = (DisplayName = "Output Format", editcondition = "false", EditConditionHides))
81
82 //runtime type (support "NNERuntimeORTDml" only at this moment)
83 UPROPERTY(Category = "Model", EditAnywhere, BlueprintReadOnly)
85
87 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Model, meta = (DisplayName = "NNE Model Data"))
88 TObjectPtr<UObject> NNEModelData;
89
91 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Model, meta = (DisplayName = "Input Dimension", editcondition = "false"))
92 FIntVector4 InputDimension;
93
95 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Model, meta = (DisplayName = "Output Dimension", editcondition = "false"))
96 FIntVector4 OutputDimension;
97
99 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Override", meta = (DisplayName = "Batch Size"))
100 int32 BatchSizeOverride;
101
103 UPROPERTY(EditAnywhere, Category = "Tile")
105
107 UPROPERTY(EditAnywhere, Category = "Tile", meta = (DisplayName = "Border Overlaps"))
108 FIntPoint TileOverlap;
109
110 UPROPERTY(EditAnywhere, Category = "Tile", meta = (DisplayName = "Overlap Resolve Type"))
111 ETileOverlapResolveType TileOverlapResolveType;
112
114 {
115 InputFormat = ENeuralProfileFormat::Type32;
116 OutputFormat = ENeuralProfileFormat::Type32;
117 RuntimeType = ENeuralProfileRuntimeType::NNERuntimeORTDml;
118 NNEModelData = nullptr;
119 InputDimension = FIntVector4(0);
120 OutputDimension = FIntVector4(0);
121 TileSize = ENeuralModelTileType::OneByOne;
122 BatchSizeOverride = 1;
123 TileOverlap = FIntPoint(0, 0);
124 TileOverlapResolveType = ETileOverlapResolveType::Ignore;
125 }
126
128 {
129 *this = FNeuralProfileStruct();
130 }
131};
132
141{
143
144public:
145
146 UPROPERTY(Category = UNeuralProfile, EditAnywhere, meta = (ShowOnlyInnerProperties))
148
149 UPROPERTY()
151
152 void BeginDestroy();
153 virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent);
154};
155
157{
158 // Profile - Initializes or updates the contents of the neural profile.
160
162
163 // Profile - Returns the profile ID for a given neural profile object
165
166 // Experimental APIs to manage neural profiles.
168 {
169 public:
171
172 virtual void UpdateModel(int32 AllocationId, UObject* NNEModelData, FString RuntimeName) = 0;
173 virtual void RemoveModel(int32 AllocationId) = 0;
174
176 virtual bool UpdateBatchSize(int32 AllocationId, int32 BatchSize) = 0;
177 virtual void UpdateTileOverlap(int32 AllocationId, FIntPoint TileOverlap) = 0;
179
180 virtual FIntVector4 GetInputDimension(UObject* NNEModelData, FString RuntimeName) = 0;
181 virtual FIntVector4 GetOutputDimension(UObject* NNEModelData, FString RuntimeName) = 0;
182 };
183}
184
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::Math::TIntVector4< int32 > FIntVector4
Definition MathFwd.h:93
FInt32Point FIntPoint
Definition MathFwd.h:124
ENeuralProfileRuntimeType
Definition NeuralProfile.h:53
ENGINE_API TUniquePtr< NeuralProfile::INeuralProfileManager > GNeuralProfileManager
Definition NeuralProfile.cpp:21
ENeuralModelTileType
Definition NeuralProfile.h:22
ETileOverlapResolveType
Definition NeuralProfile.h:42
ENeuralProfileFormat
Definition NeuralProfile.h:15
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint32 Size
Definition VulkanMemory.cpp:4034
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NeuralProfile.h:168
virtual void UpdateTileOverlapResolveType(int32 AllocationId, ETileOverlapResolveType TileOverlapResolveType)=0
virtual FIntVector4 GetOutputDimension(UObject *NNEModelData, FString RuntimeName)=0
virtual void RemoveModel(int32 AllocationId)=0
virtual void UpdateTileOverlap(int32 AllocationId, FIntPoint TileOverlap)=0
virtual FIntVector4 GetInputDimension(UObject *NNEModelData, FString RuntimeName)=0
virtual bool UpdateBatchSize(int32 AllocationId, int32 BatchSize)=0
virtual ~INeuralProfileManager()
Definition NeuralProfile.h:170
virtual void UpdateModel(int32 AllocationId, UObject *NNEModelData, FString RuntimeName)=0
virtual void UpdateTileType(int32 AllocationId, ENeuralModelTileType ModelTileSize)=0
Definition UniquePtr.h:107
Definition NeuralProfile.h:141
Definition Object.h:95
Definition NeuralProfile.h:157
ENGINE_API int32 GetNeuralProfileId(const UNeuralProfile *In)
Definition NeuralProfile.cpp:285
ENGINE_API FNeuralProfileStruct GetProfileSetting(int32 AllocationId)
Definition NeuralProfile.cpp:301
ENGINE_API int32 AddOrUpdateProfile(const UNeuralProfile *InProfile, const FGuid &InGuid, const FNeuralProfileStruct InSettings)
Definition NeuralProfile.cpp:296
@ false
Definition radaudio_common.h:23
Definition Guid.h:109
Definition NeuralProfile.h:65
void Invalidate()
Definition NeuralProfile.h:127
Definition UnrealType.h:6865
Definition ObjectPtr.h:488
Definition IntPoint.h:25