Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 399
    • Issues 399
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2358
Closed
Open
Created Nov 29, 2023 by Michiel Verloop@MVerloopMaintainer

SRP fails for divisors greater than 2

The below program has different behaviours for -dosrp and -nosrp (both with -maxwlmp 3)

use Array: all;
use Math: all;
use StdIO: all;


noinline
int[.] test ()
{
    return {[i] -> mod(i + 2, 3) | [i] < [10]};
}

int main()
{
    print(test());

    return 0;
}
>>> sac2c_p -maxwlmp 5 test.sac -dosrp  && ./a.out
Dimension:  1
Shape    : < 25>
< 2  3  0  0  0  2  3  0  0  0  2  3  0  0  0  2  3  0  0  0  2  3  0  0  0 >
>>> sac2c_p -maxwlmp 5 test.sac -nosrp  && ./a.out
Dimension:  1
Shape    : < 25>
< 2  3  4  0  1  2  3  4  0  1  2  3  4  0  1  2  3  4  0  1  2  3  4  0  1 >

This behaviour is caused by SRPlowerBoundRec in wl_modulo_partitioning.c. It's supposed to recursively compute the new bounds, but instead it computes the base case + a single recursive step. As a consequence, all partitions after the second are equal to the second, and nothing is computed for the values meant to be covered by the other partitions.

Edited Nov 29, 2023 by Michiel Verloop
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking