MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ lane_reduction()

std::string MayaFlux::Yantra::detail::lane_reduction ( std::string_view scratch,
std::string_view type,
std::string_view combine )
inline

Definition at line 130 of file WindowedKernelAnalyzer.hpp.

131 {
132 std::string body;
133 body += " uint l = gl_LocalInvocationID.x;\n";
134 body += " " + std::string(scratch) + "[l] = v;\n";
135 body += " barrier();\n";
136 body += " for (uint s = gl_WorkGroupSize.x / 2u; s > 0u; s >>= 1u) {\n";
137 body += " if (l < s) { " + std::string(scratch) + "[l] = " + std::string(combine) + "; }\n";
138 body += " barrier();\n";
139 body += " }\n";
140 body += " " + std::string(type) + " r = " + std::string(scratch) + "[0];\n";
141 body += " barrier();\n";
142 body += " return r;";
143 return body;
144 }

References lane_reduction().

Referenced by lane_reduction().

Here is the call graph for this function:
Here is the caller graph for this function: