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

Improve algorithm implementation for compiler optimization, closes #150 #155

Merged
merged 1 commit into from
Feb 6, 2022
Merged

Improve algorithm implementation for compiler optimization, closes #150 #155

merged 1 commit into from
Feb 6, 2022

Conversation

Neel-Shah-29
Copy link
Contributor

@Neel-Shah-29 Neel-Shah-29 commented Feb 6, 2022

This PR fixes issue #150 by providing the trailing return type and passing the lambda through one of its arguments.

@Neel-Shah-29 Neel-Shah-29 changed the title This fixes #150 Removing the use of std::function from tensor. This fixes Removing the use of std::function from tensor #150 Feb 6, 2022
@amitsingh19975
Copy link
Collaborator

Follow https://www.conventionalcommits.org/en/v1.0.0/ for a commit message, and be more explicit about the message rather than generic.

@Neel-Shah-29
Copy link
Contributor Author

Follow https://www.conventionalcommits.org/en/v1.0.0/ for a commit message, and be more explicit about the message rather than generic.

Yes sure I will do it. Also issue is resolved right as all checks are passed so i dont need to make any further changes right?

@Neel-Shah-29 Neel-Shah-29 changed the title This fixes Removing the use of std::function from tensor #150 Refactor algorithms for enabling compiler optimizations in algorithms.cpp Feb 6, 2022
@Neel-Shah-29
Copy link
Contributor Author

I have made the required changes.

Copy link
Collaborator

@amitsingh19975 amitsingh19975 left a comment

Choose a reason for hiding this comment

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

There're a few indentation issues, but they can be fixed in the future. So, you don't have to worry about them.

Everything looks good, and thanks for contributing.

@bassoy bassoy changed the title Refactor algorithms for enabling compiler optimizations in algorithms.cpp Refactor algorithms by enabling compiler optimizations in algorithms.cpp Feb 6, 2022
@bassoy
Copy link
Collaborator

bassoy commented Feb 6, 2022

There're a few indentation issues, but they can be fixed in the future. So, you don't have to worry about them.

We should fix them now if we have any. @amitsingh19975 Please annotate the lines which you think need better indentation.

Everything looks good, and thanks for contributing.

Copy link
Collaborator

@bassoy bassoy left a comment

Choose a reason for hiding this comment

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

One line needs to be indented.

std::function<ValueType(SizeType r, PointerIn a, ValueType k)> lambda;

lambda = [&lambda, n, w](SizeType r, PointerIn a, ValueType k)
auto lambda = [n, w](auto const& self, SizeType r, PointerIn a, ValueType k)-> ValueType
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing indendation.

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 with the changes

@bassoy bassoy changed the title Refactor algorithms by enabling compiler optimizations in algorithms.cpp Fixes issue https://github.com/boostorg/ublas/issues/150 Feb 6, 2022
@amitsingh19975
Copy link
Collaborator

@bassoy, what's your thought on moving trailing return type on to the next line for better readability.

@bassoy bassoy changed the title Fixes issue https://github.com/boostorg/ublas/issues/150 Improve algorithm implementation for compiler optimization, closes #150 Feb 6, 2022
@amitsingh19975
Copy link
Collaborator

@Neel-Shah-29 could you indent the trailing return type a bit.

@Neel-Shah-29
Copy link
Contributor Author

@Neel-Shah-29 could you indent the trailing return type a bit.

I have brought the trailing return type to next line , do i need to indent it more towards the left side.

@amitsingh19975
Copy link
Collaborator

amitsingh19975 commented Feb 6, 2022

@Neel-Shah-29 could you indent the trailing return type a bit.

I have brought the trailing return type to next line , do i need to indent it more towards the left side.

Yes, but indent toward the right side.

From

auto fn = ...
->

To

auto fn = ...
    ->

…ns in algorithms.cpp

Compiler cannot perform small-object and other optimizations in algorithms.cpp . This is solved by providing the trailing return type and passing the lambda through one of its arguments.

Fixes #150
@Neel-Shah-29
Copy link
Contributor Author

@Neel-Shah-29 could you indent the trailing return type a bit.

I have brought the trailing return type to next line , do i need to indent it more towards the left side.

Yes, but indent toward the right side.

From

auto fn = ...
->

To

auto fn = ...
    ->

Done with all the changes which were suggested . Kindly have a look once. Thankyou

@bassoy bassoy merged commit c5850f6 into boostorg:develop Feb 6, 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.

Compiler cannot perform small-object and other optimizations in algorithms.cpp
3 participants