Avoid reserved identifiers
- [x] Identifiers starting with two consecutive underscores are reserved in C++ (meaning user-defined program are not allowed to use them)
e.g.
orbatched/dense/impl/KokkosBatched_Axpy_Impl.hpp:16:#ifndef __KOKKOSBATCHED_AXPY_IMPL_HPP__ batched/dense/impl/KokkosBatched_Axpy_Impl.hpp:17:#define __KOKKOSBATCHED_AXPY_IMPL_HPP__batched/dense/impl/KokkosBatched_HostLevel_Gemm_Armpl_Impl.hpp:74: HandleType *const __handle; batched/dense/impl/KokkosBatched_HostLevel_Gemm_Armpl_Impl.hpp:80: AViewType __A; batched/dense/impl/KokkosBatched_HostLevel_Gemm_Armpl_Impl.hpp:81: avt *__Adp = nullptr; batched/dense/impl/KokkosBatched_HostLevel_Gemm_Armpl_Impl.hpp:82: armpl_int_t __Ajstrd, __Aistrd, __Abstrd; batched/dense/impl/KokkosBatched_HostLevel_Gemm_Armpl_Impl.hpp:84: BViewType __B; - [ ] Identifiers starting with an underscore followed by an uppercase letter are reserved in C++
For example
batched/dense/impl/KokkosBatched_HostLevel_Gemm_Serial_Impl.hpp:131: BatchedSerialGemm(ScalarType _alpha, AViewType _A, BViewType _B, ScalarType _beta, CViewType _C) batched/dense/impl/KokkosBatched_HostLevel_Gemm_Serial_Impl.hpp:132: : A(_A), B(_B), C(_C), alpha(_alpha), beta(_beta) {} - [x] Avoid defining macros starting with
KOKKOS_(this includes header guards)
instead consider doing KOKKOSBLAS_ or KOKKOSKERNELS_BLAS, etc.blas/impl/KokkosBlas_util.hpp:18:#define KOKKOS_BLAS_UTIL_HPP blas/tpls/KokkosBlas_tpl_spec.hpp:89:#define KOKKOS_CUBLAS_SAFE_CALL_IMPL(call) KokkosBlas::Impl::cublas_internal_safe_call(call, #call, __FILE__, __LINE__)
Most KOKKOS_ macros are either include guards or Impl and we can search/replace, except this one: https://github.com/kokkos/kokkos-kernels/issues/2371
The issue has only been partially addressed: they are still Identifiers starting with an underscore followed by an uppercase letter (2nd item on the list)
Is that an oversight or something that you deliberately consider a "won't fix"?
Oversight, I thought we had that resolved with the round of PRs that @cwpearson made recently. We can reopen
podman run --rm -it \
-v ${PWD}:/opt/kokkos-kernels \
-v ${PWD}/kokkos:/opt/kokkos \
ghcr.io/cwpearson/clang:16.0.6-cmake3.25.3
cmake -S /opt/kokkos -B build-kokkos \
-DCMAKE_INSTALL_PREFIX=install-kokkos \
-DCMAKE_CXX_COMPILER=clang++
cmake --build build-kokkos --parallel $(nproc) --target install
cmake -S /opt/kokkos-kernels -B build \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DKokkos_ROOT=install-kokkos \
-DKokkosKernels_ENABLE_TESTS=ON \
-DKokkosKernels_ENABLE_BENCHMARKS=ON \
-DKokkosKernels_ENABLE_PERFTESTS=ON \
-DKokkosKernels_ENABLE_EXAMPLES=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
cmake --build build --parallel 4
I think this is finally done