petabricks/petabricks — Issue #23: Issue with region:genTypeStr const ElementT&
Author: mangpo
Created: 2011-12-01 16:30:47+00:00
State: open

On distributed branch. Due to the change of genTypeStr function from generating "const ElementT" to "const ElementT&" to fix testRuleIr, it breaksConvFFTRecursion. To reproduce the bug, run with sequentialcutoff = 0

./examples/convolution2/ConvFFTRecursion --fixedrandom --noisolation ./testdata/Rand1D ./testdata/Rand1D -
SIZE 16
-nan 0 0 0 99.5625 0 0 0 -nan 0 0 0 99.5625 0 0 0

The issue is that when we store reference const ElementT& instead of value (specifically for this case, variable "offset"). When we call FFTRecursion(outx, outy, x, y, tempx1, tempy1, n, offset, delta), we always change the global "offset" to the new value. As a result, all FFTRecursion_rule1_workstealing instances point to the same offset.

Yod said we need to store references because sometimes we enqueue tasks before all input data is available. Storing values will cause tasks to operate on stale data (i.e. testRuleIr benchmark).