forked from pytorch/executorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: We use ascii encoding instead of hex to make it consistent with codegen. Reviewed By: larryliu0820 Differential Revision: D53681267 fbshipit-source-id: d459ae8157429d8a4cba223db7d4b14fa7abf0d6
- Loading branch information
1 parent
a3dec31
commit 6d54911
Showing
7 changed files
with
78 additions
and
59 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
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
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,34 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include <executorch/runtime/core/exec_aten/exec_aten.h> | ||
|
||
namespace torch { | ||
namespace executor { | ||
void make_kernel_key_string(ArrayRef<TensorMeta> key, char* buf); | ||
|
||
inline void make_kernel_key( | ||
std::vector<std::pair<ScalarType, std::vector<exec_aten::DimOrderType>>> | ||
tensors, | ||
char* buf) { | ||
std::vector<TensorMeta> meta; | ||
for (auto& t : tensors) { | ||
ArrayRef<exec_aten::DimOrderType> dim_order( | ||
t.second.data(), t.second.size()); | ||
meta.emplace_back(t.first, dim_order); | ||
} | ||
auto meatadata = ArrayRef<TensorMeta>(meta.data(), meta.size()); | ||
make_kernel_key_string(meatadata, buf); | ||
} | ||
|
||
} // namespace executor | ||
} // namespace torch |