1#ifndef __COMMON_EXPORT_HPP__
2#define __COMMON_EXPORT_HPP__
4#include "Kokkos_Macros.hpp"
5#include <biocma_cst_config.hpp>
6#include <common/alg.hpp>
7#include <common/execinfo.hpp>
8#include <common/traits.hpp>
11using ComputeSpace = Kokkos::DefaultExecutionSpace;
12using HostSpace = Kokkos::HostSpace;
14#ifdef ENABLE_KOKKOS_PROFILING
15# include <Kokkos_Profiling_ScopedRegion.hpp>
16# define PROFILE_SECTION(__label_section__) \
17 Kokkos::Profiling::ScopedRegion region(__label_section__);
19# define PROFILE_SECTION(__label_section__) ;
22#define EIGEN_INDEX(__VALUE__) static_cast<int>(__VALUE__)
26# include <source_location>
36 explicit Canary(std::string_view lbl, std::source_location location)
41 std::cout << location.function_name() <<
": " << lbl << std::endl;
46 std::cout <<
"END " <<
_lbl << std::endl;
52# define MkCanary(x) Canary(x, std::source_location());
57inline Kokkos::TeamPolicy<ComputeSpace> get_policy_auto(std::size_t range)
60 Kokkos::TeamPolicy<ComputeSpace> _policy;
62 int recommended_team_size = _policy.team_size_recommended(
64 const Kokkos::TeamPolicy<ComputeSpace>::member_type& team_handle) {
65 std::size_t idx = team_handle.league_rank() * team_handle.team_size() +
66 team_handle.team_rank();
72 Kokkos::ParallelForTag());
73 int league_size = (
static_cast<int>(range) + recommended_team_size - 1) /
74 recommended_team_size;
77 Kokkos::TeamPolicy<ComputeSpace>(league_size, recommended_team_size);
Canary & operator=(const Canary &)=delete
~Canary()
Definition common.hpp:44
Canary(std::string_view lbl, std::source_location location)
Definition common.hpp:36
Canary(const Canary &)=delete
Canary & operator=(Canary &&)=delete
std::string _lbl
Definition common.hpp:50