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

Avoid reserved identifiers #2364

Open
3 tasks
dalg24 opened this issue Oct 7, 2024 · 1 comment
Open
3 tasks

Avoid reserved identifiers #2364

dalg24 opened this issue Oct 7, 2024 · 1 comment
Labels
Cleanup Code maintenance that isn't a bugfix or new feature

Comments

@dalg24
Copy link
Member

dalg24 commented Oct 7, 2024

  • Identifiers starting with two consecutive underscores are reserved in C++ (meaning user-defined program are not allowed to use them)
    e.g.
    batched/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__
    
    or
    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) {}
    
  • Avoid defining macros starting with KOKKOS_ (this includes header guards)
    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__)
    
    instead consider doing KOKKOSBLAS_ or KOKKOSKERNELS_BLAS, etc.
@dalg24 dalg24 added the Cleanup Code maintenance that isn't a bugfix or new feature label Oct 7, 2024
@cwpearson
Copy link
Contributor

cwpearson commented Oct 10, 2024

Most KOKKOS_ macros are either include guards or Impl and we can search/replace, except this one: #2371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Code maintenance that isn't a bugfix or new feature
Projects
None yet
Development

No branches or pull requests

2 participants