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 prefixes to macros #571

Merged
merged 10 commits into from
Oct 15, 2024
Merged

Add prefixes to macros #571

merged 10 commits into from
Oct 15, 2024

Conversation

s-Nick
Copy link
Contributor

@s-Nick s-Nick commented Sep 17, 2024

Description

This PR adds ONEAPI_ONEMKL_ prefix to all the variables defined in config.hpp.in to be conformant with ES.33 C++ Core Guidelines.

Fixes # (GitHub issue)

This change was requested in #554

Checklist

All Submissions

@s-Nick s-Nick requested a review from Rbiessy September 17, 2024 09:23
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
deps/googletest/cmake/internal_utils.cmake Outdated Show resolved Hide resolved
src/CMakeLists.txt Show resolved Hide resolved
src/CMakeLists.txt Show resolved Hide resolved
Copy link
Contributor

@Rbiessy Rbiessy left a comment

Choose a reason for hiding this comment

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

LGTM!

CMakeLists.txt Outdated
@@ -294,8 +294,8 @@ else()
endif()

if(DEFINED REF_BLAS_ROOT)
find_file(REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64)
find_file(REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64)
find_file(ONEAPI_ONEMKL_REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64)
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall the change looks okay to me, my only concern is about the macro prefix choice. ONEAPI_ONEMKL is a little bit redundant and heavy in my opinion, could we consider using only ONEMKL or follow the namespace with ONEAPI_MKL (this one would have my preference)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we could use ONEAPI_MKL as I vaguely remember we had to remove occurrences of "MKL" in the past. The exceptions are the name of the backends MKLCPU, MKLGPU and the mkl namespace.
I don't mind too much between ONEAPI_ONEMKL or ONEMKL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your review @lhuot.
I agree it is quite verbose. In my opinion, the best option is to use ONEMKL for now, so that it can be renamed later in ONEMATH. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine by me. @mkrainiuk any concern with the macro prefix that should be used?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also support shorter name if possible (longer macro name increase the chance of a typo), ONEMKL looks great to me while we are migrating to oneMath, but does it make sense to start changing it to ONEMATH already to reduce users efforts for migrating to new macro names in their build configurations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you for the feedback @mkrainiuk,
I don't like the idea of having these variables already renamed while everything else isn't. I know @Rbiessy is working on it, but I don't want to have this period with different names in between his renaming patch and this one. Moreover, these variables change should not affect users but only internal headers. So I would rather use ONEMKL for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, it's fine to me as long as it doesn't affect the users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed names in 2a739a8

include/oneapi/mkl/detail/export.hpp Show resolved Hide resolved
#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND
#cmakedefine ONEAPI_ONEMKL_BUILD_SHARED_LIBS
#cmakedefine ONEAPI_ONEMKL_REF_BLAS_LIBNAME "@ONEAPI_ONEMKL_REF_BLAS_LIBNAME@"
#cmakedefine ONEAPI_ONEMKL_REF_CBLAS_LIBNAME "@ONEAPI_ONEMKL_REF_CBLAS_LIBNAME@"
Copy link
Contributor

Choose a reason for hiding this comment

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

These two can be removed now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed while rebasing to include this change

src/CMakeLists.txt Outdated Show resolved Hide resolved
This commit update the macros used internally adding the prefix
ONEAPI_ONEMKL_. This change creates a mismatch between the cmake
variables used for configuration and the internal macros. Cmake
configuration stays the same while, macros are now conformant with C++
guidelines.

Signed-off-by: nscipione <nicolo.scipione@codeplay.com>
Moved variables setting for headers to a more appropriate section of
the configuration.
Reducing macro name from "ONEAPI_ONEMKL" to "ONEMKL"
@s-Nick s-Nick merged commit 331fe8a into oneapi-src:develop Oct 15, 2024
8 checks passed
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.

4 participants