Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler returns wrong position dynamically #170

Open
NeuralCoder3 opened this issue Jan 12, 2023 · 0 comments
Open

Scheduler returns wrong position dynamically #170

NeuralCoder3 opened this issue Jan 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@NeuralCoder3
Copy link
Collaborator

NeuralCoder3 commented Jan 12, 2023

The generated code is:

.con eta_f_1436134 _1436139::[a_1436177: .Idx 4294967296, return_1436141: .Cn .Idx 4294967296] @(0:(.Idx 2)) = {
    .let _1436184: .Idx 4294967296 = %core.wrap.add 4294967296 0 (2:(.Idx 4294967296), a_1436177);
    return_1436141 _1436184
};
.con eta_f_1436234 _1436235::[a_1436239: .Idx 4294967296, return_1436237: .Cn .Idx 4294967296] @(0:(.Idx 2)) = {
    .let _1436246: .Idx 4294967296 = %core.wrap.add 4294967296 0 (2:(.Idx 4294967296), a_1436239);
    return_1436237 _1436246
};
.con .extern main __1436033::[mem_1436050: %mem.M, .Idx 4294967296, %mem.Ptr (%mem.Ptr (.Idx 256, 0), 0), return_1436037: .Cn [%mem.M, .Idx 4294967296]] @(0:(.Idx 2)) = {
    .con eta_f_cps_cont_1436350 _1436381: .Idx 4294967296 @(0:(.Idx 2)) = {
        .con eta_f_cps_cont_1436287 _1436318: .Idx 4294967296 @(0:(.Idx 2)) = {
            return_1436037 (mem_1436050, _1436381) // Start code
        };
        eta_f_1436234 (38:(.Idx 4294967296), eta_f_cps_cont_1436287)
    };
    eta_f_1436134 (_1436318, eta_f_cps_cont_1436350)
};

First we start with

.con .extern main __1436033::[mem_1436050: %mem.M, .Idx 4294967296, %mem.Ptr (%mem.Ptr (.Idx 256, 0), 0), return_1436037: .Cn [%mem.M, .Idx 4294967296]] @(0:(.Idx 2)) = {
    return_1436037 (mem_1436050, _1436381) // Start code
};

We look at the simple case:
We place eta_f_1436234 (38:(.Idx 4294967296), eta_f_cps_cont_1436287) with the computed entry nominal main and construct the scope and scheduler.
The resulting place is main. We place the app in default fashion by moving the body of main.

.con .extern main __1436033::[mem_1436050: %mem.M, .Idx 4294967296, %mem.Ptr (%mem.Ptr (.Idx 256, 0), 0), return_1436037: .Cn [%mem.M, .Idx 4294967296]] @(0:(.Idx 2)) = {
    eta_f_1436234 (38:(.Idx 4294967296), eta_f_cps_cont_1436287)
};

.con eta_f_cps_cont_1436287 _1436318: .Idx 4294967296 @(0:(.Idx 2)) = {
    return_1436037 (mem_1436050, _1436381)
};


.con eta_f_1436234 _1436235::[a_1436239: .Idx 4294967296, return_1436237: .Cn .Idx 4294967296] @(0:(.Idx 2)) = {
    .let _1436246: .Idx 4294967296 = %core.wrap.add 4294967296 0 (2:(.Idx 4294967296), a_1436239);
    return_1436237 _1436246
};

To place eta_f_1436134 (_1436318, eta_f_cps_cont_1436350), we again compute the scope entry main, construct the scope, the scheduler.
But the scheduler suggests the place main resulting in the wrong order above.
The correct place would be eta_f_cps_cont_1436287 as the tuple requires the argument _1436318 of eta_f_cps_cont_1436287.

Code used to place:

// entry is computed
Scope scope(entry);
Scheduler sched_(scope);
auto place = sched_.smart(app); 
@NeuralCoder3 NeuralCoder3 added the bug Something isn't working label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant