Skip to content

Commit

Permalink
enable c++20 for dml/winml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheil Kumar committed Oct 4, 2023
1 parent 3eb33e9 commit f1f912e
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Dml
ComPtr<ID3D12Resource> resource;
auto buffer = CD3DX12_RESOURCE_DESC::Buffer(size, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS);
ORT_THROW_IF_FAILED(m_device->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT),
unmove_ptr(CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT)),
D3D12_HEAP_FLAG_NONE,
&buffer,
D3D12_RESOURCE_STATE_UNORDERED_ACCESS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
#include <assert.h>
#include "core/providers/dml/OperatorAuthorHelper/Common.h"

template <class T>
auto unmove_ptr(T&& t) {
return &static_cast<T&>(t);

Check warning on line 11 in onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlCommon.h

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlCommon.h#L11

Are you taking an address of a cast? This is dangerous: could be a temp var. Take the address before doing the cast, rather than after [runtime/casting] [4]
Raw output
onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlCommon.h:11:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
}

namespace Dml
{
using namespace OperatorHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ namespace Dml

bool IsCpuOnDmlOperator(const onnxruntime::Node& node)
{
auto cpuOnDmlOperators = std::array<char*, 8>{
auto cpuOnDmlOperators = std::array<const char*, 8>{
"SequenceAt",
"SequenceConstruct",
"SequenceEmpty",
Expand All @@ -659,7 +659,7 @@ namespace Dml

bool IsDmlSequenceOperator(const onnxruntime::Node& node)
{
auto sequence_ops = std::array<char*, 1>{
auto sequence_ops = std::array<const char*, 1>{
"ConcatFromSequence"
};

Expand All @@ -675,7 +675,7 @@ namespace Dml

bool IsCustomOpShader(const onnxruntime::Node& node)
{
auto custom_ops = std::array<char*, 3>{
auto custom_ops = std::array<const char*, 3>{
"DFT",
"STFT",
"GridSample"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ class DmlOperatorBatchNormalization15 : public DmlOperator, BatchNormalizationHe
);

DML_EXECUTION_FLAGS executionFlags = GetExecutionFlags();
m_compiledOperator.Attach(graph.Compile(executionFlags, { batchNormalization }).Detach());
std::array<dml::Expression, 1> outputs = { batchNormalization };
m_compiledOperator.Attach(graph.Compile(executionFlags, outputs).Detach());
}

void Compute(const MLOperatorKernelContext& kernelContext) override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DmlOperatorPooling : public DmlOperator, public PoolingHelperBase
poolingDesc.EndPadding = m_kernel.endPadding;

DML_OPERATOR_DESC opDesc = {};
opDesc.Type = ApiTraits::OperatorDescTraits<std::remove_reference<decltype(poolingDesc)>::type>::Type;
opDesc.Type = ApiTraits::OperatorDescTraits<typename std::remove_reference<decltype(poolingDesc)>::type>::Type;
opDesc.Desc = &poolingDesc;
SetDmlOperatorDesc(opDesc, kernelInfo);
};
Expand Down
4 changes: 2 additions & 2 deletions winml/lib/Api.Image/CpuDetensorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CpuDetensorizer {
}

template <>
static float ReadTensor<DirectX::PackedVector::HALF>(
float ReadTensor<DirectX::PackedVector::HALF>(
const DirectX::PackedVector::HALF* pCPUTensor, const NominalRangeConverter& nominalRangeConverter
) {
return nominalRangeConverter.Denormalize(DirectX::PackedVector::XMConvertHalfToFloat(*pCPUTensor));
Expand Down Expand Up @@ -169,7 +169,7 @@ class CpuDetensorizer {

#if defined(_M_AMD64) || defined(_M_IX86)
template <>
static void InterleaveRowFloatToByte(
void InterleaveRowFloatToByte(
const float* xChannel,
const float* yChannel,
const float* zChannel,
Expand Down
6 changes: 3 additions & 3 deletions winml/lib/Api.Image/CpuTensorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ class CpuTensorizer {
static T ConvertByteToFloat(const BYTE& input, const NominalRangeConverter& nominalRangeConverter);

template <>
static float ConvertByteToFloat(const BYTE& input, const NominalRangeConverter& nominalRangeConverter) {
float ConvertByteToFloat(const BYTE& input, const NominalRangeConverter& nominalRangeConverter) {
return nominalRangeConverter.Normalize(static_cast<float>(input));
}
template <>
static DirectX::PackedVector::HALF ConvertByteToFloat(
DirectX::PackedVector::HALF ConvertByteToFloat(
const BYTE& input, const NominalRangeConverter& nominalRangeConverter
) {
return nominalRangeConverter.Normalize(DirectX::PackedVector::XMConvertFloatToHalf(input));
Expand Down Expand Up @@ -161,7 +161,7 @@ class CpuTensorizer {

#if defined(_M_AMD64) || defined(_M_IX86)
template <>
static void DeinterleaveRowByteToFloat(
void DeinterleaveRowByteToFloat(
_In_ BYTE* pBuffer,
_Inout_ float* xChannel,
_Inout_ float* yChannel,
Expand Down
34 changes: 17 additions & 17 deletions winml/lib/Api.Image/TensorToVideoFrameConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ void TensorToVideoFrameConverter::ConvertGPUTensorToDX12Texture(
if (!UAV_resource_ || outputDesc.Format != UAV_resource_->GetDesc().Format ||
outputDesc.Width != UAV_resource_->GetDesc().Width || outputDesc.Height != UAV_resource_->GetDesc().Height) {
WINML_THROW_IF_FAILED(device_cache.GetD3D12Device()->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT),
unmove_ptr(CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT)),
D3D12_HEAP_FLAG_NONE,
&outputResourceDesc,
D3D12_RESOURCE_STATE_UNORDERED_ACCESS,
Expand Down Expand Up @@ -599,31 +599,31 @@ void TensorToVideoFrameConverter::ConvertGPUTensorToDX12Texture(

command_list_->ResourceBarrier(
1,
&CD3DX12_RESOURCE_BARRIER::Transition(
unmove_ptr(CD3DX12_RESOURCE_BARRIER::Transition(
pInputResource, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE
)
))

Check warning on line 604 in winml/lib/Api.Image/TensorToVideoFrameConverter.cpp

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] winml/lib/Api.Image/TensorToVideoFrameConverter.cpp#L604

Closing ) should be moved to the previous line [whitespace/parens] [2]
Raw output
winml/lib/Api.Image/TensorToVideoFrameConverter.cpp:604:  Closing ) should be moved to the previous line  [whitespace/parens] [2]
);
command_list_->Dispatch(dispatchWidth, dispatchHeight, 1);
command_list_->ResourceBarrier(
1,
&CD3DX12_RESOURCE_BARRIER::Transition(
unmove_ptr(CD3DX12_RESOURCE_BARRIER::Transition(
pInputResource, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS
)
))

Check warning on line 611 in winml/lib/Api.Image/TensorToVideoFrameConverter.cpp

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] winml/lib/Api.Image/TensorToVideoFrameConverter.cpp#L611

Closing ) should be moved to the previous line [whitespace/parens] [2]
Raw output
winml/lib/Api.Image/TensorToVideoFrameConverter.cpp:611:  Closing ) should be moved to the previous line  [whitespace/parens] [2]
);

// Copy the UAV data to the output resource after detensorization
command_list_->ResourceBarrier(
1,
&CD3DX12_RESOURCE_BARRIER::Transition(
unmove_ptr(CD3DX12_RESOURCE_BARRIER::Transition(
UAV_resource_.Get(), D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE
)
))

Check warning on line 619 in winml/lib/Api.Image/TensorToVideoFrameConverter.cpp

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] winml/lib/Api.Image/TensorToVideoFrameConverter.cpp#L619

Closing ) should be moved to the previous line [whitespace/parens] [2]
Raw output
winml/lib/Api.Image/TensorToVideoFrameConverter.cpp:619:  Closing ) should be moved to the previous line  [whitespace/parens] [2]
);
command_list_->CopyResource(pOutputResource, UAV_resource_.Get());
command_list_->ResourceBarrier(
1,
&CD3DX12_RESOURCE_BARRIER::Transition(
unmove_ptr(CD3DX12_RESOURCE_BARRIER::Transition(
UAV_resource_.Get(), D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS
)
))

Check warning on line 626 in winml/lib/Api.Image/TensorToVideoFrameConverter.cpp

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] winml/lib/Api.Image/TensorToVideoFrameConverter.cpp#L626

Closing ) should be moved to the previous line [whitespace/parens] [2]
Raw output
winml/lib/Api.Image/TensorToVideoFrameConverter.cpp:626:  Closing ) should be moved to the previous line  [whitespace/parens] [2]
);

WINML_THROW_IF_FAILED(command_list_->Close());
Expand Down Expand Up @@ -657,9 +657,9 @@ void TensorToVideoFrameConverter::ConvertGPUTensorToSoftwareBitmap(
// TODO: Make an allocator for readback heaps
if (!readback_heap_ || readback_heap_->GetDesc().Width < singleVideoFramebufferSize) {
WINML_THROW_IF_FAILED(device_cache.GetD3D12Device()->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_READBACK),
unmove_ptr(CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_READBACK)),
D3D12_HEAP_FLAG_NONE,
&CD3DX12_RESOURCE_DESC::Buffer(singleVideoFramebufferSize),
unmove_ptr(CD3DX12_RESOURCE_DESC::Buffer(singleVideoFramebufferSize)),
D3D12_RESOURCE_STATE_COPY_DEST,
nullptr,
IID_PPV_ARGS(&readback_heap_)
Expand Down Expand Up @@ -689,12 +689,12 @@ void TensorToVideoFrameConverter::ConvertGPUTensorToSoftwareBitmap(
device_cache.SyncD3D12ToCPU();

void* pCPUTensorBuffer = nullptr;
WINML_THROW_IF_FAILED(readback_heap_->Map(0, &CD3DX12_RANGE(0, singleVideoFramebufferSize), &pCPUTensorBuffer));
WINML_THROW_IF_FAILED(readback_heap_->Map(0, unmove_ptr(CD3DX12_RANGE(0, singleVideoFramebufferSize)), &pCPUTensorBuffer));

Check warning on line 692 in winml/lib/Api.Image/TensorToVideoFrameConverter.cpp

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] winml/lib/Api.Image/TensorToVideoFrameConverter.cpp#L692

Lines should be <= 120 characters long [whitespace/line_length] [2]
Raw output
winml/lib/Api.Image/TensorToVideoFrameConverter.cpp:692:  Lines should be <= 120 characters long  [whitespace/line_length] [2]

// We avoid the Video Frame pipeline by manually downloading the GPU data to the CPU and detensorize while we are filling the readback heap
ConvertCPUTensorToSoftwareBitmap(pCPUTensorBuffer, tensorDesc, softwareBitmap);

readback_heap_->Unmap(0, &CD3DX12_RANGE(0, 0));
readback_heap_->Unmap(0, unmove_ptr(CD3DX12_RANGE(0, 0)));
}

void TensorToVideoFrameConverter::ConvertBatchedDX12TensorToBuffers(
Expand All @@ -708,9 +708,9 @@ void TensorToVideoFrameConverter::ConvertBatchedDX12TensorToBuffers(
// TODO: Make an allocator for readback heaps
if (!readback_heap_ || readback_heap_->GetDesc().Width < buffer_size_in_bytes) {
WINML_THROW_IF_FAILED(device_cache.GetD3D12Device()->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_READBACK),
unmove_ptr(CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_READBACK)),
D3D12_HEAP_FLAG_NONE,
&CD3DX12_RESOURCE_DESC::Buffer(buffer_size_in_bytes),
unmove_ptr(CD3DX12_RESOURCE_DESC::Buffer(buffer_size_in_bytes)),
D3D12_RESOURCE_STATE_COPY_DEST,
nullptr,
IID_PPV_ARGS(&readback_heap_)
Expand All @@ -734,7 +734,7 @@ void TensorToVideoFrameConverter::ConvertBatchedDX12TensorToBuffers(

byte* readback_buffer = nullptr;
WINML_THROW_IF_FAILED(
readback_heap_->Map(0, &CD3DX12_RANGE(0, buffer_size_in_bytes), reinterpret_cast<void**>(&readback_buffer))
readback_heap_->Map(0, unmove_ptr(CD3DX12_RANGE(0, buffer_size_in_bytes)), reinterpret_cast<void**>(&readback_buffer))

Check warning on line 737 in winml/lib/Api.Image/TensorToVideoFrameConverter.cpp

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] winml/lib/Api.Image/TensorToVideoFrameConverter.cpp#L737

Lines should be <= 120 characters long [whitespace/line_length] [2]
Raw output
winml/lib/Api.Image/TensorToVideoFrameConverter.cpp:737:  Lines should be <= 120 characters long  [whitespace/line_length] [2]
);
auto readback_buffer_span = gsl::span<byte>(readback_buffer, buffer_size_in_bytes);
_winml::StoreSpanIntoDisjointBuffers(
Expand All @@ -748,7 +748,7 @@ void TensorToVideoFrameConverter::ConvertBatchedDX12TensorToBuffers(
readback_buffer_span
);

readback_heap_->Unmap(0, &CD3DX12_RANGE(0, 0));
readback_heap_->Unmap(0, unmove_ptr(CD3DX12_RANGE(0, 0)));
}

D3D12_SHADER_RESOURCE_VIEW_DESC TensorToVideoFrameConverter::CreateSRVDescriptor(
Expand Down
16 changes: 8 additions & 8 deletions winml/lib/Api.Image/VideoFrameToTensorConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,24 +600,24 @@ void VideoFrameToTensorConverter::ConvertSoftwareBitmapToGPUTensor(
// TODO: Make an allocator for upload heaps
if (!upload_heap_ || upload_heap_->GetDesc().Width < bufferSize) {
WINML_THROW_IF_FAILED(device_cache.GetD3D12Device()->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD),
unmove_ptr(CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD)),
D3D12_HEAP_FLAG_NONE,
&CD3DX12_RESOURCE_DESC::Buffer(bufferSize),
unmove_ptr(CD3DX12_RESOURCE_DESC::Buffer(bufferSize)),
D3D12_RESOURCE_STATE_GENERIC_READ,
nullptr,
IID_PPV_ARGS(&upload_heap_)
));
}

void* pCPUTensorBuffer = nullptr;
WINML_THROW_IF_FAILED(upload_heap_->Map(0, &CD3DX12_RANGE(0, 0), &pCPUTensorBuffer));
WINML_THROW_IF_FAILED(upload_heap_->Map(0, unmove_ptr(CD3DX12_RANGE(0, 0)), unmove_ptr(pCPUTensorBuffer)));

// We avoid the Video Frame pipeline by manually sending the CPU data to the GPU, and we tensorize while we are filling the
// upload heap. The image may already have been cropped/scaled by the video frame pipeline, so we send the scaled bounds
// instead of the initial input bounds
ConvertSoftwareBitmapToCPUTensor(convertedSoftwareBitmap, tensorDesc, scaledBounds, pCPUTensorBuffer);

upload_heap_->Unmap(0, &CD3DX12_RANGE(0, bufferSize));
upload_heap_->Unmap(0, unmove_ptr(CD3DX12_RANGE(0, bufferSize)));

ResetCommandList(device_cache);

Expand All @@ -642,17 +642,17 @@ void VideoFrameToTensorConverter::ConvertBuffersToBatchedGPUTensor(
// Copy the cpu memory into the gpu resource
if (!upload_heap_ || upload_heap_->GetDesc().Width < buffer_size_in_bytes) {
WINML_THROW_IF_FAILED(device_cache.GetD3D12Device()->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD),
unmove_ptr(CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD)),
D3D12_HEAP_FLAG_NONE,
&CD3DX12_RESOURCE_DESC::Buffer(buffer_size_in_bytes),
unmove_ptr(CD3DX12_RESOURCE_DESC::Buffer(buffer_size_in_bytes)),
D3D12_RESOURCE_STATE_GENERIC_READ,
nullptr,
IID_PPV_ARGS(&upload_heap_)
));
}

byte* gpu_buffer = nullptr;
WINML_THROW_IF_FAILED(upload_heap_->Map(0, &CD3DX12_RANGE(0, 0), reinterpret_cast<void**>(&gpu_buffer)));
WINML_THROW_IF_FAILED(upload_heap_->Map(0, unmove_ptr(CD3DX12_RANGE(0, 0)), reinterpret_cast<void**>(&gpu_buffer)));
auto gpu_buffer_span = gsl::span<byte>(gpu_buffer, buffer_size_in_bytes);

_winml::LoadSpanFromDisjointBuffers(
Expand All @@ -666,7 +666,7 @@ void VideoFrameToTensorConverter::ConvertBuffersToBatchedGPUTensor(
gpu_buffer_span
);

upload_heap_->Unmap(0, &CD3DX12_RANGE(0, buffer_size_in_bytes));
upload_heap_->Unmap(0, unmove_ptr(CD3DX12_RANGE(0, buffer_size_in_bytes)));

ResetCommandList(device_cache);

Expand Down
12 changes: 10 additions & 2 deletions winml/lib/Api.Image/inc/D3DDeviceCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ enum class PipelineStateCacheOperation : unsigned char {
kCount = 2
};

template <typename E>
constexpr auto to_underlying_integer(E e) noexcept {
return static_cast<typename std::underlying_type<E>::type>(e);
}


class D3DDeviceCache {
public:
~D3DDeviceCache();
Expand Down Expand Up @@ -105,8 +111,10 @@ class D3DDeviceCache {
winrt::com_ptr<ID3D12RootSignature> detensorize_root_signature_;

winrt::com_ptr<ID3D12PipelineState>
cached_pipeline_state[PipelineStateCacheType::kCount][PipelineStateCacheFormat::kCount]
[PipelineStateCacheFormat::kCount][PipelineStateCacheOperation::kCount];
cached_pipeline_state[to_underlying_integer(PipelineStateCacheType::kCount)]
[to_underlying_integer(PipelineStateCacheFormat::kCount)]
[to_underlying_integer(PipelineStateCacheFormat::kCount)]
[to_underlying_integer(PipelineStateCacheOperation::kCount)];

winrt::com_ptr<ID3D12Resource> detensorize_vertex_buffer_;

Expand Down
2 changes: 1 addition & 1 deletion winml/lib/Api.Image/inc/TensorToVideoFrameConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TensorToVideoFrameConverter : public ImageConverter {
_Inout_ wm::VideoFrame& unsupported_video_frame
);

static D3D12_SHADER_RESOURCE_VIEW_DESC TensorToVideoFrameConverter::CreateSRVDescriptor(
static D3D12_SHADER_RESOURCE_VIEW_DESC CreateSRVDescriptor(
const UINT32 batch_index, const D3D12_RESOURCE_DESC& resource_description, const ImageTensorDescription& description
);

Expand Down
2 changes: 1 addition & 1 deletion winml/lib/Api.Image/inc/VideoFrameToTensorConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class VideoFrameToTensorConverter : public ImageConverter {
const UINT32 batch_index, const D3D12_RESOURCE_DESC& resource_description, const ImageTensorDescription& description
);

static void VideoFrameToTensorConverter::ConvertSoftwareBitmapToCPUTensor(
static void ConvertSoftwareBitmapToCPUTensor(
_In_ const wgi::SoftwareBitmap& software_bitmap,
_In_ const ImageTensorDescription& tensor_description,
_In_ const wgi::BitmapBounds& input_bounds,
Expand Down
8 changes: 4 additions & 4 deletions winml/lib/Api.Ort/OnnxruntimeEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,12 @@ struct FillMapTensors {
static HRESULT Run(
const OrtApi* ort_api, IInspectable* map_insp, OrtValue* keys_ort_value, OrtValue* values_ort_value
) {
AbiTypeInfo<TAbiKey>::OrtType* keys_mutable_data;
typename AbiTypeInfo<TAbiKey>::OrtType* keys_mutable_data;
RETURN_HR_IF_NOT_OK_MSG(
ort_api->GetTensorMutableData(keys_ort_value, reinterpret_cast<void**>(&keys_mutable_data)), ort_api
);

AbiTypeInfo<TAbiValue>::OrtType* values_mutable_data;
typename AbiTypeInfo<TAbiValue>::OrtType* values_mutable_data;
RETURN_HR_IF_NOT_OK_MSG(
ort_api->GetTensorMutableData(values_ort_value, reinterpret_cast<void**>(&values_mutable_data)), ort_api
);
Expand All @@ -888,7 +888,7 @@ struct FillMapTensors<HSTRING, TAbiValue> {
static HRESULT Run(
const OrtApi* ort_api, IInspectable* map_insp, OrtValue* keys_ort_value, OrtValue* values_ort_value
) {
AbiTypeInfo<TAbiValue>::OrtType* values_mutable_data;
typename AbiTypeInfo<TAbiValue>::OrtType* values_mutable_data;
RETURN_HR_IF_NOT_OK_MSG(
ort_api->GetTensorMutableData(values_ort_value, reinterpret_cast<void**>(&values_mutable_data)), ort_api
);
Expand Down Expand Up @@ -916,7 +916,7 @@ struct FillMapTensors<TAbiKey, HSTRING> {
static HRESULT Run(
const OrtApi* ort_api, IInspectable* map_insp, OrtValue* keys_ort_value, OrtValue* values_ort_value
) {
AbiTypeInfo<TAbiKey>::OrtType* keys_mutable_data;
typename AbiTypeInfo<TAbiKey>::OrtType* keys_mutable_data;
RETURN_HR_IF_NOT_OK_MSG(
ort_api->GetTensorMutableData(keys_ort_value, reinterpret_cast<void**>(&keys_mutable_data)), ort_api
);
Expand Down
2 changes: 1 addition & 1 deletion winml/lib/Api/ImageFeatureValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct ImageFeatureValue : ImageFeatureValueT<ImageFeatureValue, _winml::ILotusV
wfc::IIterable<Windows::Media::VideoFrame> VideoFrames();
winml::LearningModelFeatureKind Kind();

static winml::ImageFeatureValue ImageFeatureValue::Create(
static winml::ImageFeatureValue Create(
uint32_t batchSize, Windows::Graphics::Imaging::BitmapPixelFormat format, uint32_t width, uint32_t height
);
static winml::ImageFeatureValue CreateFromVideoFrame(Windows::Media::VideoFrame const& image);
Expand Down
2 changes: 2 additions & 0 deletions winml/lib/Api/impl/MapBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "MapFeatureDescriptor.h"
#include "TensorFeatureDescriptor.h"
#include "LearningModelSession.h"
#include "IMapFeatureValue.h"

namespace _winml {

Expand Down
Loading

0 comments on commit f1f912e

Please sign in to comment.