algorithm - OpenCL matrix reduction in two stages -
i have 2d array of m x n entries.
a0 a1 a2 a3 a4 a5 ... b0 b1 b2 b3 b4 b5 ... bn ...
i want reduce array single value in 2 stages.
stage 1: calculate function values each item in row, , sum them weights.
a = w0*f(a0) + w1*f(a1) + w2*f(a2) + ... b = w0*f(b0) + w1*f(b1) + w2*f(b2) + ...
stage 2: compare results input vector , calculate chi-square value.
chi_sq = (a - x)^2/sx^2 + (b - y)^2/sy^2 + ...
i trying in parallel using opencl. however, have hard time figuring out best strategy kind of algorithm. example, there many examples out there loop on matrix rows, , many sources state should not this. kind outline how problem can solved optimally?
Comments
Post a Comment