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

fix: nested namespace holding kk mkl implementation #2100

Closed
wants to merge 1 commit into from

Conversation

maartenarnst
Copy link

This PR fixes a compilation error when compiling Trilinos/kokkos-kernels when both mkl and rocsparse are enabled.

Compilation errors look like this:

/Trilinos-sources/packages/kokkos-kernels/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp:35:7: error: no member named 'mode_kk_to_mkl' in namespace 'KokkosSparse::Experimental::Impl::KokkosSparse::Impl'; did you mean '::KokkosSparse::Impl::mode_kk_to_mkl'?

The fix is to add a :: so as to look for KokkosSparse::Impl explicitly in the global namespace.

@kokkos-devops-admin
Copy link

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@lucbv
Copy link
Contributor

lucbv commented Feb 15, 2024

@maartenarnst sorry for the slow comment here... why not use a non qualified name instead of using this fully qualified one since we are in the same namespace? I think that would look cleaner...

@@ -63,7 +63,7 @@ inline void mkl_internal_safe_call(sparse_status_t mkl_status, const char *name,
}

#define KOKKOSKERNELS_MKL_SAFE_CALL(call) \
KokkosSparse::Impl::mkl_internal_safe_call(call, #call, __FILE__, __LINE__)
::KokkosSparse::Impl::mkl_internal_safe_call(call, #call, __FILE__, __LINE__)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
::KokkosSparse::Impl::mkl_internal_safe_call(call, #call, __FILE__, __LINE__)
mkl_internal_safe_call(call, #call, __FILE__, __LINE__)

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure. I agree that the macro is defined here in a piece of code inside the KokkosSparse::Impl namespace. But, then, when the macro is used somewhere else, this namespace is not taken with it.

E.g. when it's used here

it's called in a piece of code in the KokkosSparse namespace without the Impl. So shouldn't we keep the proposed change?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point this would obviously create issues. Would you mind moving the definition of the macro KOKKOSKERNELS_MKL_SAFE_CALL to line 232, just after the namespaces are closed?
My suspicion is at that point the leading :: in your fix might not be needed anymore?

@lucbv
Copy link
Contributor

lucbv commented Mar 6, 2024

I opened PR #2134 that fixes the issue in a way that I find cleaner, let me know if you have an issues closing this?

@lucbv
Copy link
Contributor

lucbv commented Mar 13, 2024

@maartenarnst can you see if your issues are resolved with PR #2134 being merged now?
I will close this and maybe create an issue instead to track the problem further if there is still a build problem on your end.

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.

3 participants