mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fix a bug in execution_provider.cc
This commit is contained in:
parent
657d46fb3c
commit
7c70d9349a
2 changed files with 4 additions and 2 deletions
|
|
@ -373,7 +373,8 @@ typedef enum OrtAllocatorType {
|
|||
} OrtAllocatorType;
|
||||
|
||||
/**
|
||||
memory types for allocator, exec provider specific types should be extended in each provider
|
||||
* memory types for allocator, exec provider specific types should be extended in each provider
|
||||
* Whenever this struct is updated, please also update the MakeKey function in onnxruntime/core/framework/execution_provider.cc
|
||||
*/
|
||||
typedef enum OrtMemType {
|
||||
OrtMemTypeCPUInput = -2, // Any CPU memory used by non-CPU execution provider
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@
|
|||
namespace onnxruntime {
|
||||
|
||||
namespace {
|
||||
//It assumes max(OrtMemType) <= 1, min(OrtMemType) = -2
|
||||
inline int MakeKey(int id, OrtMemType mem_type) {
|
||||
return id << 2 | mem_type;
|
||||
return id << 2 | (mem_type + 2);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue