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

Function GetSummationPart

tensorflow/lite/delegates/gpu/metal/kernels/conv.cc:97–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97std::string GetSummationPart(int num_output_slices, int index) {
98 std::string code = R"(
99 {
100 const FLT4 src = src_buffer[src_address];
101 src_address += params.dillation_layer_offsets.z;
102 )";
103 for (int d = 0; d < num_output_slices; ++d) {
104 code += absl::Substitute(R"(
105 sum$6.x += dot(temp[$0 * $1 + $2], src) * multiplier;
106 sum$6.y += dot(temp[$0 * $1 + $3], src) * multiplier;
107 sum$6.z += dot(temp[$0 * $1 + $4], src) * multiplier;
108 sum$6.w += dot(temp[$0 * $1 + $5], src) * multiplier;
109 )",
110 index, num_output_slices * 4, d * 4 + 0, d * 4 + 1,
111 d * 4 + 2, d * 4 + 3, d);
112 }
113 code += "}";
114 return code;
115}
116
117std::string GetBiasReadingPart(int num_output_slices) {
118 std::string code = absl::Substitute(R"(

Callers 1

GetKernelForConvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected