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

Set separate chaining #2198

Merged
merged 8 commits into from
Jul 31, 2023
Merged

Conversation

kabra1110
Copy link
Collaborator

Adds separate chaining for sets.

Copy link
Collaborator

@czgdp1807 czgdp1807 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping me whenever this is ready for review.

@kabra1110 kabra1110 changed the title [WIP] Set separate chaining Set separate chaining Jul 29, 2023
} else {
set_api = set_api_lp;
}
// set_api = set_api_lp;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will benchmark separate chaining, and modify this accordingly

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated this in the gist. Separate Chaining does not appear to provide significant benefits.

@kabra1110 kabra1110 requested a review from czgdp1807 July 30, 2023 00:17
@kabra1110 kabra1110 marked this pull request as ready for review July 30, 2023 00:17
@czgdp1807
Copy link
Collaborator

@kabra1110 There is one error in debug build CI. Could you please look into that?

@kabra1110
Copy link
Collaborator Author

@kabra1110 There is one error in debug build CI. Could you please look into that?

I had tried looking it earlier, but this does not appear locally, and the error also doesn't seem to be correct

semantic error: Type Mismatch in return, found ('i32' and 'c64')
   --> /home/runner/work/lpython/lpython/src/bin/../runtime/lpython_builtin.py:371:5
    |
371 |     return c64(x) + c64(y)*1j
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ 

The function is

@interface
@overload
def complex(x: f64, y: f64) -> c64:
    """
    Return a complex number with the given real and imaginary parts.
    """
    return c64(x) + c64(y)*1j

This appears OK

@kabra1110
Copy link
Collaborator Author

@czgdp1807 Looks like this is good to merge. I have made Linear Probing as default for sets, but haven't removed set_set_api(), in case that is needed later.

@czgdp1807 czgdp1807 enabled auto-merge (squash) July 31, 2023 13:00
@czgdp1807 czgdp1807 merged commit 3927b92 into lcompilers:main Jul 31, 2023
9 checks passed
@certik
Copy link
Contributor

certik commented Jul 31, 2023

Awesome, great job!

kabra1110 added a commit to kabra1110/lpython that referenced this pull request Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants