Skip to content

s258 benchmark function could be cheated #8

@pinskia

Description

@pinskia

s258 contains this inside the inner loop

	  if (a[i] > 0.)
	    {
	      s = d[i] * d[i];
	    }

BUT a[i] > 0. is always true due to the initialization of a array which does:

if (!strcmp(name, "s258")) {
        set_1d_array(a, LEN_1D, any,frac);

set_1d_array does this for frac (SET1D_RECIP_IDX):

        for (int i = 0; i < length; i++) {
            arr[i] = 1. / (real_t) (i+1);
        }

If the compiler decides not to generate a conditional move, the HW might be able to predict the branch correctly through the loop and that is cheating what the benchmark is trying to benchmark here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions