Add prefixes to macros in in config.hpp.in #554
Labels
help wanted
Tasks, issues or features that could be implemented and contributed to the project
RFC
A proposal to add new API
Summary
To prevent potential macro naming conflicts between oneMKL and client applications, this RFC proposes adding a unique prefix (such as
ONEMKL_
orONEAPI_ONEMKL_
) to all macros defined in oneMKL's public API.Problem statement
oneMKL defines a bunch of configuration macros in
config.hpp
, which is transitively included in the<oneapi/mkl.hpp>
file.Those are
ENABLE_<backend>_BACKEND
for each enabled backend,BUILD_SHARED_LIBS
andREF_(BLAS|CBLAS)_LIBNAME
.As a consequence, the client application that tries to use oneMKL will also have them all defined. This could be useful, but, since macros don't obey any scope rules, they can also easily cause confusion if the client application itself uses, e.g.,
ENABLE_CUFFT_BACKEND
orBUILD_SHARED_LIBS
.ES.33 in C++ Core Guidelines recommends adding supposedly unique prefixes (e.g., your organization’s name) to the macro names.
As such, I suggest adding
ONEMKL_
orONEAPI_ONEMKL_
prefix to all the macros defined in the public API.Details
The text was updated successfully, but these errors were encountered: