MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetGlobalAddress

Function GetGlobalAddress

tensorflow/lite/delegates/gpu/cl/kernels/util.cc:107–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107std::string GetGlobalAddress(TensorStorageType storage_type,
108 const std::string& size_name,
109 const std::string& var_name, const std::string& x,
110 const std::string& y, const std::string& z) {
111 const std::string address =
112 GetGlobalAddressNoDeclaration(storage_type, size_name, x, y, z);
113 switch (storage_type) {
114 case TensorStorageType::BUFFER:
115 return absl::StrCat("int ", var_name, " = ", address, ";\n");
116 case TensorStorageType::TEXTURE_2D:
117 return absl::StrCat("int2 ", var_name, " = ", address, ";\n");
118 case TensorStorageType::SINGLE_TEXTURE_2D:
119 return absl::StrCat("int2 ", var_name, " = ", address, ";\n");
120 case TensorStorageType::TEXTURE_ARRAY:
121 return absl::StrCat("int4 ", var_name, " = ", address, ";\n");
122 case TensorStorageType::UNKNOWN:
123 return "";
124 }
125}
126
127std::string GetReadImageFromDataType(DataType data_type) {
128 if (data_type == DataType::FLOAT32) {

Callers 1

GetAddressMethod · 0.85

Calls 2

StrCatFunction · 0.50

Tested by

no test coverage detected