Skip to content

Commit ff7f0c8

Browse files
pytorchbotSS-JIA
andauthored
[ET-VK][ez] Add print operator for StorageType enum
## Context As title. Add a long overdue print operator for the `StorageType` enum, similar to the one that already exists for the `GPUMemoryLayout` enum. Differential Revision: [D68237420](https://our.internmc.facebook.com/intern/diff/D68237420/) ghstack-source-id: 261607000 Pull Request resolved: #7685 Co-authored-by: Stephen Jia <[email protected]>
1 parent 17ef5c1 commit ff7f0c8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

backends/vulkan/runtime/utils/StorageUtils.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@ T to_packed_dim(const GPUMemoryLayout layout) {
112112
return 0;
113113
}
114114

115+
inline std::ostream& operator<<(
116+
std::ostream& os,
117+
const StorageType storage_type) {
118+
switch (storage_type) {
119+
case kBuffer:
120+
os << "BUFFER";
121+
break;
122+
case kTexture3D:
123+
os << "TEXTURE_3D";
124+
break;
125+
case kTexture2D:
126+
os << "TEXTURE_2D";
127+
break;
128+
}
129+
return os;
130+
}
131+
115132
inline std::ostream& operator<<(
116133
std::ostream& os,
117134
const GPUMemoryLayout layout) {

0 commit comments

Comments
 (0)