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

Add integer exponent code sample to JitBuilder #6652

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

sudip-unb
Copy link
Contributor

@sudip-unb sudip-unb commented Aug 11, 2022

Provide a new JitBuilder sample code that demonstrates how to compute power(a,n) using the DoWhileLoop construct to multiply a by itself n times (n is an integer). This code sample will be included in the set of default code samples that runs when OMR_JITBUILDERTEST is enabled in cmake builds.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for supporting the project, and congratulations on your first contribution! A project committer will shortly review your contribution. In the mean time, if you haven't had a chance please skim over the contribution guidelines which all pull requests must adhere to. If the ECA pull request check fails, have a look at the instructions for signing the ECA in the legal considerations section.

If you run into any problems our community will be happy to assist you in any way we can. There are a number of recommended ways to interact with the community. We encourage you to ask questions, or drop by to say hello.

@sudip-unb sudip-unb force-pushed the jitbuilder-samplecode branch 2 times, most recently from afd9f9e to 6d23609 Compare August 11, 2022 19:10
Copy link
Contributor

@mstoodle mstoodle left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, Sudip, it's great to see more code samples being added for JitBuilder!

Please put your commit title into the active voice, e.g. "Add JitBuilder power function sample:"

There are two sign-offs in your commit (you only need one), and please fix the typo in your commit summary: "jirbuilder".

I think your commit summary could include a bit more information about how the sample works, i.e. "calculates integer powers by iterating over the exponent" or something like that.

OMR::JitBuilder::TypeDictionary types;

printf("Step 3: compile method builder\n");
PowerMethod PowerMethod(&types);
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't the variable have a different name than the class? i.e. PowerMethod powerMethod(&types);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@sudip-unb sudip-unb force-pushed the jitbuilder-samplecode branch 4 times, most recently from f894443 to 49c9cb8 Compare August 29, 2022 14:43
@sudip-unb sudip-unb changed the title Jitbuilder sample code for calculating power function in math Add JitBuilder power function sample for mathematical operation Aug 29, 2022
@mstoodle
Copy link
Contributor

mstoodle commented Aug 30, 2022

Hi @sudip-unb, the code looks good now. Would you please add a bit more information to the commit message on what the code does and (high level) how it computes the result as I suggested earlier? As an example, please see this commit: 3112c66 .

@sudip-unb
Copy link
Contributor Author

sudip-unb commented Aug 31, 2022

Hi @mstoodle,
I have updated the commit message with a high-level description of the code. Would you please have a look?
Thanks in advance.

@mstoodle
Copy link
Contributor

Hi @sudip-unb I see the updated description in the PR, but the commit message still looks like:

Add JitBuilder power function sample

Signed-off-by: sudip-unb <sudip.chatterjee@unb.ca>

i.e. it has only a subject and is otherwise empty...

@sudip-unb sudip-unb force-pushed the jitbuilder-samplecode branch 2 times, most recently from a17680c to f11c27c Compare September 13, 2022 13:35
@sudip-unb
Copy link
Contributor Author

@mstoodle I have updated the commit message.

@sudip-unb sudip-unb changed the title Add JitBuilder power function sample for mathematical operation Add integer exponent code sample to JitBuilder Sep 21, 2022
@mstoodle
Copy link
Contributor

mstoodle commented Nov 2, 2022

Just so it doesn't look like this one has been left idling (should have documented this back in mid September): I reached out to @sudip-unb directly to explain what it is I'm looking for in the commit message. Once that change is made, I think this PR is good to go.

@mstoodle mstoodle self-assigned this Nov 2, 2022
@mstoodle
Copy link
Contributor

mstoodle commented Nov 30, 2022

Sorry, I had missed the commit message change that was pushed 4 weeks ago :( .

This PR look good to me now. I've asked @sudip-unb to rebase onto the latest, at which point I'll run more tests and merge it (assuming they pass :) ).

@mstoodle
Copy link
Contributor

jenkins build all

@sudip-unb
Copy link
Contributor Author

sudip-unb commented Nov 30, 2022

@mstoodle rebase is done and all the checks are fine, however, the build shows some issues.

Provide a new JitBuilder sample code that demonstrates how to compute power(a,n) using the DoWhileLoop construct to multiply a by itself n times (n is an integer).

Signed-off-by: Sudip Chatterjee <sudip.chatterjee@unb.ca>
@mstoodle
Copy link
Contributor

jenkins build all

@mstoodle
Copy link
Contributor

The failure looks like #6571 which has been failing for a while now ( :( ). I'm approving and will merge.

Thanks @sudip-unb !

@mstoodle mstoodle merged commit 8006739 into eclipse-omr:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants