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 Sor kernels #1634

Open
wants to merge 7 commits into
base: sor
Choose a base branch
from
Open

Add Sor kernels #1634

wants to merge 7 commits into from

Conversation

MarcelKoch
Copy link
Member

This PR adds the device kernels for #1633.

@MarcelKoch MarcelKoch self-assigned this Jun 27, 2024
@ginkgo-bot ginkgo-bot added reg:build This is related to the build system. mod:cuda This is related to the CUDA module. mod:openmp This is related to the OpenMP module. reg:benchmarking This is related to benchmarking. type:preconditioner This is related to the preconditioners mod:hip This is related to the HIP module. type:factorization This is related to the Factorizations mod:dpcpp This is related to the DPC++ module. labels Jun 27, 2024
@MarcelKoch MarcelKoch force-pushed the sor-kernels branch 2 times, most recently from 0d29fae to 1f1ef07 Compare June 28, 2024 15:09
@MarcelKoch MarcelKoch force-pushed the sor-kernels branch 2 times, most recently from a94cab2 to 7c59123 Compare July 10, 2024 08:00
@MarcelKoch MarcelKoch force-pushed the sor-kernels branch 3 times, most recently from a30fee7 to 79ed6d7 Compare July 11, 2024 07:26
common/cuda_hip/factorization/factorization_helpers.hpp Outdated Show resolved Hide resolved
namespace factorization {
namespace helpers {

using namespace ::gko::factorization;
Copy link
Member

Choose a reason for hiding this comment

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

it does not help anything below, so I would rather remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

To make this more reasonable, I also removed the factorization namespace in the core file. Otherwise I would have had to use ::gko::factorization:: everywhere instead of just helpers::.

Copy link
Member

Choose a reason for hiding this comment

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

sorry, I thought they are in the same namespace, but one is under kernel namespace and the other is under gko directly.
then the original one is better as it does not give any ambiguous function.
although it can only declare the two class you need, it's a bit annoying with the template.

namespace helpers {


using namespace ::gko::factorization;
Copy link
Member

Choose a reason for hiding this comment

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

same here and for the others.

@@ -0,0 +1,67 @@
// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
Copy link
Member

Choose a reason for hiding this comment

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

I think the file can go into unified one but you need to do dispatch on the header of factorization_helpers.hpp

Copy link
Member

Choose a reason for hiding this comment

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

you may need to use GKO_KERNEL for the lambda function.
Maybe also for the actual kernel?

Copy link
Member Author

Choose a reason for hiding this comment

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

I feel like this complicates our unified setup again, and it's not using the unified kernels as intended.
We use the unified kernels, when the kernel implementation are identical, which is not the case here. I think it's close, but it would require some adjustments of the factorization kernels. If that's feasible, I would prefer to do it in another PR.

- formatting
- remove inline namespace

Co-authored-by: Yu-Hsiang M. Tsai <yhmtsai@gmail.com>
} // namespace factorization
} // namespace GKO_DEVICE_NAMESPACE
} // namespace kernels
} // namespace gko
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
} // namespace gko
} // namespace gko

nit

namespace factorization {
namespace helpers {

using namespace ::gko::factorization;
Copy link
Member

Choose a reason for hiding this comment

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

sorry, I thought they are in the same namespace, but one is under kernel namespace and the other is under gko directly.
then the original one is better as it does not give any ambiguous function.
although it can only declare the two class you need, it's a bit annoying with the template.

Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

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

LGTM. I need to take my previous comment about the using namespace back because I thought they are in the same namespace, which is wrong.

@MarcelKoch MarcelKoch added this to the Ginkgo 1.9.0 milestone Aug 26, 2024
@MarcelKoch MarcelKoch requested a review from a team August 27, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:ready-for-review This PR is ready for review mod:cuda This is related to the CUDA module. mod:dpcpp This is related to the DPC++ module. mod:hip This is related to the HIP module. mod:openmp This is related to the OpenMP module. reg:benchmarking This is related to benchmarking. reg:build This is related to the build system. type:factorization This is related to the Factorizations type:preconditioner This is related to the preconditioners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants