-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DML EP] Add dynamic graph compilation (#18199)
- Loading branch information
1 parent
c273f7a
commit bc533a6
Showing
26 changed files
with
1,160 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlEdgeShapes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#pragma once | ||
|
||
namespace Windows::AI::MachineLearning::Adapter | ||
{ | ||
// edges and unused edges have an empty array of dimensions. | ||
class EdgeShapes | ||
{ | ||
public: | ||
EdgeShapes() = default; | ||
|
||
EdgeShapes(size_t count) : m_shapes(count) {} | ||
|
||
const std::vector<uint32_t>& GetShape(size_t edgeIndex) const | ||
{ | ||
return m_shapes[edgeIndex]; | ||
} | ||
|
||
std::vector<uint32_t>& GetMutableShape(size_t edgeIndex) | ||
{ | ||
return m_shapes[edgeIndex]; | ||
} | ||
|
||
size_t EdgeCount() const { return m_shapes.size(); } | ||
|
||
void Reset(size_t edge_count) | ||
{ | ||
m_shapes.clear(); | ||
m_shapes.resize(edge_count); | ||
} | ||
|
||
bool operator!=(const EdgeShapes& other) const noexcept | ||
{ | ||
return (m_shapes != other.m_shapes); | ||
} | ||
|
||
private: | ||
std::vector<std::vector<uint32_t>> m_shapes; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.