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 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 25
    • Merge requests 25
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2430
Closed
Open
Created Aug 28, 2024 by Sven-Bodo Scholz@sbsOwner

fold mt problem

When compiling

noinline
int add( int a, int b)
{ return _add_SxS_ (a, b); }

noinline
 bool[.] true_indexes(bool vector) {
    return vector ? with {} : genarray([10],false) : with {} : genarray ([17], false);
}

noinline
int count_true(bool[17] b) {
   v = with {
        ([0] <= iv < [17]) : _sel_VxA_(iv, b) ? 1 : 0;
       } : fold(add, 0);
   return v;
}

int main() {

    W = true_indexes(false);

    Wlen = _sel_VxA_([0], _shape_A_(W));

    compatible = with {
        ([0] <= [i] < [Wlen]) {
            w = with {([0] <= [j] <[Wlen]): _sel_VxA_([i], W); } : genarray ([Wlen], false);
            V_prime_basis = count_true(w);
          }: V_prime_basis;
       } : fold(add,0);
    return compatible;
}

with sac2c-d -tmt_pth Reproduction.sac using

sac2c-d -V
sac2c 1.3.3-MijasCosta-1240-g5b9e2
build-type: DEBUG
built-by: "sbs" at 2024-08-17T09:34:32

we get:

/Volumes/Users/sbs/Dropbox/BodoSac/quinten/a.out.c:2335:169: error: too many arguments to function call, expected 4, have 5
      _tcp_3252_SACp_emal_2748_w = rdata[SAC_MT_son_id].in_0;; SACf__MAIN_CL_MT__add__i__i (SAC_MT_self, &SACl_compatible, SACl_compatible, _tcp_3252_SACp_emal_2748_w, _tcp_3252_SACp_emal_2748_w__desc);;;
                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Users/sbs/Dropbox/BodoSac/quinten/a.out.c:1159:6: note: 'SACf__MAIN_CL_MT__add__i__i' declared here
void SACf__MAIN_CL_MT__add__i__i( struct sac_bee_pth_t *SAC_MT_self, int * SAC_arg_1__p, int SACl_a, int SACl_b)
     ^
1 error generated.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking