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

Function WriteGlobalFLT4

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

Source from the content-addressed store, hash-verified

214}
215
216std::string WriteGlobalFLT4(TensorStorageType storage_type, DataType data_type,
217 const std::string& tensor_name,
218 const std::string& size_name,
219 const std::string& var_name, const std::string& x,
220 const std::string& y, const std::string& z) {
221 switch (storage_type) {
222 case TensorStorageType::BUFFER:
223 return absl::StrCat(tensor_name, "[((", z, ") * ", size_name, ".y + (", y,
224 ")) * ", size_name, ".x + (", x, ")] = ", var_name,
225 ";\n");
226 case TensorStorageType::TEXTURE_2D:
227 return absl::StrCat(GetWriteImageFromDataType(data_type), "(",
228 tensor_name, ", (int2)((", x, "), (", y, ") * ",
229 size_name, ".w + (", z, ")), ", var_name, ");\n");
230 case TensorStorageType::SINGLE_TEXTURE_2D:
231 return absl::StrCat(GetWriteImageFromDataType(data_type), "(",
232 tensor_name, ", (int2)(", x, ", ", y, "), ", var_name,
233 ");\n");
234 case TensorStorageType::TEXTURE_ARRAY:
235 return absl::StrCat(GetWriteImageFromDataType(data_type), "(",
236 tensor_name, ", (int4)(", x, ", ", y, ", ", z,
237 ", 0), ", var_name, ");\n");
238 case TensorStorageType::UNKNOWN:
239 return "";
240 }
241}
242
243std::string WriteGlobalFLT4(TensorStorageType storage_type, DataType data_type,
244 const std::string& tensor_name,

Callers 1

Write3DMethod · 0.85

Calls 2

StrCatFunction · 0.50

Tested by

no test coverage detected