| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-O3" } */ |
| 3 |
|
| 4 |
static void addPrior(float center_x, float center_y, float width, float height, |
| 5 |
bool normalized, float *dst) |
| 6 |
{ |
| 7 |
if (normalized) |
| 8 |
{ |
| 9 |
dst[0] = (center_x - width * 0.5f); |
| 10 |
dst[1] = (center_y - height * 0.5f); |
| 11 |
dst[2] = (center_x + width * 0.5f); |
| 12 |
dst[3] = (center_y + height * 0.5f); |
| 13 |
} |
| 14 |
else |
| 15 |
{ |
| 16 |
dst[0] = center_x - width * 0.5f; |
| 17 |
dst[1] = center_y - height * 0.5f; |
| 18 |
dst[2] = center_x + width * 0.5f - 1.0f; |
| 19 |
dst[3] = center_y + height * 0.5f - 1.0f; |
| 20 |
} |
| 21 |
} |
| 22 |
void forward(float *outputPtr, int _offsetsXs, float *_offsetsX, |
| 23 |
float *_offsetsY, float _stepX, float _stepY, |
| 24 |
bool _bboxesNormalized, float _boxWidth, float _boxHeight) |
| 25 |
{ |
| 26 |
for (int j = 0; j < _offsetsXs; ++j) |
| 27 |
{ |
| 28 |
float center_x = (_offsetsX[j]) * _stepX; |
| 29 |
float center_y = (_offsetsY[j]) * _stepY; |
| 30 |
addPrior(center_x, center_y, _boxWidth, _boxHeight, _bboxesNormalized, |
| 31 |
outputPtr); |
| 32 |
outputPtr += 4; |
| 33 |
} |
| 34 |
} |