From 0077707da8962dcde707fa5622b8abbe9eee21b7 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 16 Oct 2024 13:13:34 +0000 Subject: [PATCH 1/4] [core] use `if constexpr` when registering operations --- include/ginkgo/config.hpp.in | 23 +++++++++++++ include/ginkgo/core/base/executor.hpp | 47 +++++++++++++++------------ 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/include/ginkgo/config.hpp.in b/include/ginkgo/config.hpp.in index 1dfa6bc61bc..746eea8adfd 100644 --- a/include/ginkgo/config.hpp.in +++ b/include/ginkgo/config.hpp.in @@ -89,6 +89,29 @@ // clang-format on +/* Describe which backends are enabled. */ +// clang-format off +#cmakedefine01 GINKGO_BUILD_CUDA +#cmakedefine01 GINKGO_BUILD_HIP +#cmakedefine01 GINKGO_BUILD_OMP +#cmakedefine01 GINKGO_BUILD_REFERENCE +#cmakedefine01 GINKGO_BUILD_SYCL +// clang-format on + + +namespace gko{ + +/* Provide non-macro access to which backends are available. */ +constexpr bool ginkgo_build_cuda_v = GINKGO_BUILD_CUDA; +constexpr bool ginkgo_build_hip_v = GINKGO_BUILD_HIP; +constexpr bool ginkgo_build_omp_v = GINKGO_BUILD_OMP; +constexpr bool ginkgo_build_reference_v = GINKGO_BUILD_REFERENCE; +constexpr bool ginkgo_build_sycl_v = GINKGO_BUILD_SYCL; + + +} + + /* Is MPI available ? */ // clang-format off #cmakedefine01 GINKGO_BUILD_MPI diff --git a/include/ginkgo/core/base/executor.hpp b/include/ginkgo/core/base/executor.hpp index 963e30bfddd..a2718318ffa 100644 --- a/include/ginkgo/core/base/executor.hpp +++ b/include/ginkgo/core/base/executor.hpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -423,42 +424,48 @@ RegisteredOperation make_register_operation(const char* name, return ::gko::detail::make_register_operation( \ #_kernel, [&args...](auto exec) { \ using exec_type = decltype(exec); \ - if (std::is_same< \ - exec_type, \ - std::shared_ptr>:: \ - value) { \ + if constexpr (::gko::ginkgo_build_reference_v && \ + std::is_same< \ + exec_type, \ + std::shared_ptr< \ + const ::gko::ReferenceExecutor>>:: \ + value) { \ ::gko::kernels::reference::_kernel( \ std::dynamic_pointer_cast< \ const ::gko::ReferenceExecutor>(exec), \ std::forward(args)...); \ - } else if (std::is_same< \ - exec_type, \ - std::shared_ptr>:: \ - value) { \ + } else if constexpr ( \ + ::gko::ginkgo_build_omp_v && \ + std::is_same< \ + exec_type, \ + std::shared_ptr>::value) { \ ::gko::kernels::omp::_kernel( \ std::dynamic_pointer_cast( \ exec), \ std::forward(args)...); \ - } else if (std::is_same< \ - exec_type, \ - std::shared_ptr>:: \ - value) { \ + } else if constexpr ( \ + ::gko::ginkgo_build_cuda_v && \ + std::is_same< \ + exec_type, \ + std::shared_ptr>::value) { \ ::gko::kernels::cuda::_kernel( \ std::dynamic_pointer_cast( \ exec), \ std::forward(args)...); \ - } else if (std::is_same< \ - exec_type, \ - std::shared_ptr>:: \ - value) { \ + } else if constexpr ( \ + ::gko::ginkgo_build_hip_v && \ + std::is_same< \ + exec_type, \ + std::shared_ptr>::value) { \ ::gko::kernels::hip::_kernel( \ std::dynamic_pointer_cast( \ exec), \ std::forward(args)...); \ - } else if (std::is_same< \ - exec_type, \ - std::shared_ptr>:: \ - value) { \ + } else if constexpr ( \ + ::gko::ginkgo_build_sycl_v && \ + std::is_same< \ + exec_type, \ + std::shared_ptr>::value) { \ ::gko::kernels::dpcpp::_kernel( \ std::dynamic_pointer_cast( \ exec), \ From e58b1bd6e6290943a3627b28e558e35381af136d Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 16 Oct 2024 13:22:14 +0000 Subject: [PATCH 2/4] [core] remove dummy hooks --- core/device_hooks/common_kernels.inc.cpp | 994 ----------------------- core/device_hooks/cuda_hooks.cpp | 5 - core/device_hooks/dpcpp_hooks.cpp | 5 - core/device_hooks/hip_hooks.cpp | 5 - core/device_hooks/omp_hooks.cpp | 5 - core/device_hooks/reference_hooks.cpp | 5 - 6 files changed, 1019 deletions(-) delete mode 100644 core/device_hooks/common_kernels.inc.cpp diff --git a/core/device_hooks/common_kernels.inc.cpp b/core/device_hooks/common_kernels.inc.cpp deleted file mode 100644 index 1ba925e94e3..00000000000 --- a/core/device_hooks/common_kernels.inc.cpp +++ /dev/null @@ -1,994 +0,0 @@ -// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors -// -// SPDX-License-Identifier: BSD-3-Clause - -#include -#include - -#include "core/base/batch_multi_vector_kernels.hpp" -#include "core/base/device_matrix_data_kernels.hpp" -#include "core/base/index_set_kernels.hpp" -#include "core/base/mixed_precision_types.hpp" -#include "core/components/absolute_array_kernels.hpp" -#include "core/components/fill_array_kernels.hpp" -#include "core/components/format_conversion_kernels.hpp" -#include "core/components/precision_conversion_kernels.hpp" -#include "core/components/prefix_sum_kernels.hpp" -#include "core/components/reduce_array_kernels.hpp" -#include "core/distributed/index_map_kernels.hpp" -#include "core/distributed/matrix_kernels.hpp" -#include "core/distributed/partition_helpers_kernels.hpp" -#include "core/distributed/partition_kernels.hpp" -#include "core/distributed/vector_kernels.hpp" -#include "core/factorization/cholesky_kernels.hpp" -#include "core/factorization/factorization_kernels.hpp" -#include "core/factorization/ic_kernels.hpp" -#include "core/factorization/ilu_kernels.hpp" -#include "core/factorization/lu_kernels.hpp" -#include "core/factorization/par_ic_kernels.hpp" -#include "core/factorization/par_ict_kernels.hpp" -#include "core/factorization/par_ilu_kernels.hpp" -#include "core/factorization/par_ilut_kernels.hpp" -#include "core/matrix/batch_csr_kernels.hpp" -#include "core/matrix/batch_dense_kernels.hpp" -#include "core/matrix/batch_ell_kernels.hpp" -#include "core/matrix/coo_kernels.hpp" -#include "core/matrix/csr_kernels.hpp" -#include "core/matrix/dense_kernels.hpp" -#include "core/matrix/diagonal_kernels.hpp" -#include "core/matrix/ell_kernels.hpp" -#include "core/matrix/fbcsr_kernels.hpp" -#include "core/matrix/fft_kernels.hpp" -#include "core/matrix/hybrid_kernels.hpp" -#include "core/matrix/permutation_kernels.hpp" -#include "core/matrix/scaled_permutation_kernels.hpp" -#include "core/matrix/sellp_kernels.hpp" -#include "core/matrix/sparsity_csr_kernels.hpp" -#include "core/multigrid/pgm_kernels.hpp" -#include "core/preconditioner/batch_jacobi_kernels.hpp" -#include "core/preconditioner/isai_kernels.hpp" -#include "core/preconditioner/jacobi_kernels.hpp" -#include "core/reorder/rcm_kernels.hpp" -#include "core/solver/batch_bicgstab_kernels.hpp" -#include "core/solver/batch_cg_kernels.hpp" -#include "core/solver/bicg_kernels.hpp" -#include "core/solver/bicgstab_kernels.hpp" -#include "core/solver/cb_gmres_kernels.hpp" -#include "core/solver/cg_kernels.hpp" -#include "core/solver/cgs_kernels.hpp" -#include "core/solver/common_gmres_kernels.hpp" -#include "core/solver/fcg_kernels.hpp" -#include "core/solver/gcr_kernels.hpp" -#include "core/solver/gmres_kernels.hpp" -#include "core/solver/idr_kernels.hpp" -#include "core/solver/ir_kernels.hpp" -#include "core/solver/lower_trs_kernels.hpp" -#include "core/solver/multigrid_kernels.hpp" -#include "core/solver/upper_trs_kernels.hpp" -#include "core/stop/criterion_kernels.hpp" -#include "core/stop/residual_norm_kernels.hpp" - - -#ifndef GKO_HOOK_MODULE -#error "Need to define GKO_HOOK_MODULE variable before including this file" -#endif // GKO_HOOK_MODULE - - -#define GKO_STUB(_macro) _macro GKO_NOT_COMPILED(GKO_HOOK_MODULE) - -#define GKO_STUB_VALUE_CONVERSION(_macro) \ - template \ - _macro(SourceType, TargetType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_CONVERSION(_macro) - -#define GKO_STUB_NON_COMPLEX_VALUE_TYPE(_macro) \ - template \ - _macro(ValueType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE(_macro) - -#define GKO_STUB_VALUE_TYPE(_macro) \ - template \ - _macro(ValueType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_TYPE(_macro) - -#define GKO_STUB_VALUE_AND_SCALAR_TYPE(_macro) \ - template \ - _macro(ValueType, ScalarType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_AND_SCALAR_TYPE(_macro) - -#define GKO_STUB_INDEX_TYPE(_macro) \ - template \ - _macro(IndexType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_INDEX_TYPE(_macro) - -#define GKO_STUB_LOCAL_GLOBAL_TYPE(_macro) \ - template \ - _macro(LocalIndexType, GlobalIndexType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_LOCAL_GLOBAL_INDEX_TYPE(_macro) - -#define GKO_STUB_NON_COMPLEX_VALUE_AND_INDEX_TYPE(_macro) \ - template \ - _macro(ValueType, IndexType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_AND_INDEX_TYPE(_macro) - -#define GKO_STUB_VALUE_AND_INDEX_TYPE(_macro) \ - template \ - _macro(ValueType, IndexType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(_macro) - -#define GKO_STUB_VALUE_AND_INT32_TYPE(_macro) \ - template \ - _macro(ValueType, IndexType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INT32_TYPE(_macro) - -#define GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE(_macro) \ - template \ - _macro(InputValueType, MatrixValueType, OutputValueType, IndexType) \ - GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_MIXED_VALUE_AND_INDEX_TYPE(_macro) - -#define GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE_2(_macro) \ - template \ - _macro(InputValueType, OutputValueType, IndexType) \ - GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_MIXED_VALUE_AND_INDEX_TYPE_2(_macro) - -#define GKO_STUB_VALUE_AND_LOCAL_GLOBAL_INDEX_TYPE(_macro) \ - template \ - _macro(ValueType, LocalIndexType, GlobalIndexType) \ - GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_AND_LOCAL_GLOBAL_INDEX_TYPE(_macro) - -#define GKO_STUB_TEMPLATE_TYPE(_macro) \ - template \ - _macro(IndexType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_TEMPLATE_TYPE(_macro) - -#define GKO_STUB_VALUE_CONVERSION(_macro) \ - template \ - _macro(SourceType, TargetType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_CONVERSION(_macro) - -#define GKO_STUB_VALUE_CONVERSION_OR_COPY(_macro) \ - template \ - _macro(SourceType, TargetType) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_VALUE_CONVERSION_OR_COPY(_macro) - -#define GKO_STUB_CB_GMRES(_macro) \ - template \ - _macro(ValueType, ValueTypeKrylovBases) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_CB_GMRES_TYPE(_macro) - -#define GKO_STUB_CB_GMRES_CONST(_macro) \ - template \ - _macro(ValueType, ValueTypeKrylovBases) GKO_NOT_COMPILED(GKO_HOOK_MODULE); \ - GKO_INSTANTIATE_FOR_EACH_CB_GMRES_CONST_TYPE(_macro) - -namespace gko { -namespace kernels { -namespace GKO_HOOK_MODULE { -namespace components { - - -GKO_STUB_VALUE_CONVERSION(GKO_DECLARE_CONVERT_PRECISION_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PREFIX_SUM_NONNEGATIVE_KERNEL); -// explicitly instantiate for size_type, as this is -// used in the SellP format -template GKO_DECLARE_PREFIX_SUM_NONNEGATIVE_KERNEL(size_type); - -GKO_STUB_TEMPLATE_TYPE(GKO_DECLARE_FILL_ARRAY_KERNEL); -template GKO_DECLARE_FILL_ARRAY_KERNEL(bool); - -GKO_STUB_TEMPLATE_TYPE(GKO_DECLARE_FILL_SEQ_ARRAY_KERNEL); -GKO_STUB_TEMPLATE_TYPE(GKO_DECLARE_REDUCE_ADD_ARRAY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_INPLACE_ABSOLUTE_ARRAY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_OUTPLACE_ABSOLUTE_ARRAY_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_DEVICE_MATRIX_DATA_REMOVE_ZEROS_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_DEVICE_MATRIX_DATA_SUM_DUPLICATES_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_DEVICE_MATRIX_DATA_SORT_ROW_MAJOR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DEVICE_MATRIX_DATA_AOS_TO_SOA_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DEVICE_MATRIX_DATA_SOA_TO_AOS_KERNEL); - -template -GKO_DECLARE_CONVERT_PTRS_TO_IDXS(IndexType, RowPtrType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_INDEX_TYPE(GKO_DECLARE_CONVERT_PTRS_TO_IDXS32); -GKO_INSTANTIATE_FOR_EACH_INDEX_TYPE(GKO_DECLARE_CONVERT_PTRS_TO_IDXS64); -template -GKO_DECLARE_CONVERT_IDXS_TO_PTRS(IndexType, RowPtrType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_INDEX_TYPE(GKO_DECLARE_CONVERT_IDXS_TO_PTRS32); -GKO_INSTANTIATE_FOR_EACH_INDEX_TYPE(GKO_DECLARE_CONVERT_IDXS_TO_PTRS64); -template -GKO_DECLARE_CONVERT_PTRS_TO_SIZES(RowPtrType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_INDEX_TYPE(GKO_DECLARE_CONVERT_PTRS_TO_SIZES); - - -} // namespace components - - -namespace idx_set { - - -GKO_STUB_INDEX_TYPE(GKO_DECLARE_INDEX_SET_COMPUTE_VALIDITY_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_INDEX_SET_TO_GLOBAL_INDICES_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_INDEX_SET_POPULATE_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_INDEX_SET_GLOBAL_TO_LOCAL_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_INDEX_SET_LOCAL_TO_GLOBAL_KERNEL); - - -} // namespace idx_set - - -namespace partition { - - -GKO_STUB(GKO_PARTITION_COUNT_RANGES); -GKO_STUB_INDEX_TYPE(GKO_PARTITION_BUILD_FROM_CONTIGUOUS); -GKO_STUB_INDEX_TYPE(GKO_PARTITION_BUILD_FROM_MAPPING); -GKO_STUB_INDEX_TYPE(GKO_PARTITION_BUILD_FROM_GLOBAL_SIZE); -GKO_STUB_LOCAL_GLOBAL_TYPE(GKO_DECLARE_PARTITION_BUILD_STARTING_INDICES); -GKO_STUB_LOCAL_GLOBAL_TYPE(GKO_DECLARE_PARTITION_IS_ORDERED); - - -} // namespace partition - - -namespace partition_helpers { - - -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PARTITION_HELPERS_SORT_BY_RANGE_START); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PARTITION_HELPERS_CHECK_CONSECUTIVE_RANGES); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PARTITION_HELPERS_COMPRESS_RANGES); - - -} // namespace partition_helpers - - -namespace index_map { - - -GKO_STUB_LOCAL_GLOBAL_TYPE(GKO_DECLARE_INDEX_MAP_BUILD_MAPPING); -GKO_STUB_LOCAL_GLOBAL_TYPE(GKO_DECLARE_INDEX_MAP_MAP_TO_LOCAL); - - -} // namespace index_map - - -namespace distributed_vector { - - -GKO_STUB_VALUE_AND_LOCAL_GLOBAL_INDEX_TYPE( - GKO_DECLARE_DISTRIBUTED_VECTOR_BUILD_LOCAL); - - -} - -namespace distributed_matrix { - - -GKO_STUB_VALUE_AND_LOCAL_GLOBAL_INDEX_TYPE(GKO_DECLARE_SEPARATE_LOCAL_NONLOCAL); - - -} // namespace distributed_matrix - - -namespace batch_multi_vector { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_MULTI_VECTOR_SCALE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_MULTI_VECTOR_ADD_SCALED_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_MULTI_VECTOR_COMPUTE_DOT_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_MULTI_VECTOR_COMPUTE_CONJ_DOT_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_MULTI_VECTOR_COMPUTE_NORM2_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_MULTI_VECTOR_COPY_KERNEL); - - -} // namespace batch_multi_vector - - -namespace batch_csr { - - -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_CSR_SIMPLE_APPLY_KERNEL); -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_CSR_ADVANCED_APPLY_KERNEL); -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_CSR_SCALE_KERNEL); -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_CSR_ADD_SCALED_IDENTITY_KERNEL); - - -} // namespace batch_csr - - -namespace batch_dense { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_DENSE_SIMPLE_APPLY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_DENSE_ADVANCED_APPLY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_DENSE_SCALE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_DENSE_SCALE_ADD_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_DENSE_ADD_SCALED_IDENTITY_KERNEL); - - -} // namespace batch_dense - - -namespace batch_ell { - - -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_ELL_SIMPLE_APPLY_KERNEL); -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_ELL_ADVANCED_APPLY_KERNEL); -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_ELL_SCALE_KERNEL); -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_ELL_ADD_SCALED_IDENTITY_KERNEL); - - -} // namespace batch_ell - - -namespace dense { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_SIMPLE_APPLY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_APPLY_KERNEL); -GKO_STUB_VALUE_CONVERSION_OR_COPY(GKO_DECLARE_DENSE_COPY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_FILL_KERNEL); -GKO_STUB_VALUE_AND_SCALAR_TYPE(GKO_DECLARE_DENSE_SCALE_KERNEL); -GKO_STUB_VALUE_AND_SCALAR_TYPE(GKO_DECLARE_DENSE_INV_SCALE_KERNEL); -GKO_STUB_VALUE_AND_SCALAR_TYPE(GKO_DECLARE_DENSE_ADD_SCALED_KERNEL); -GKO_STUB_VALUE_AND_SCALAR_TYPE(GKO_DECLARE_DENSE_SUB_SCALED_KERNEL); -GKO_STUB_VALUE_AND_SCALAR_TYPE(GKO_DECLARE_DENSE_ADD_SCALED_IDENTITY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_ADD_SCALED_DIAG_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_SUB_SCALED_DIAG_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_DOT_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_DOT_DISPATCH_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_CONJ_DOT_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_CONJ_DOT_DISPATCH_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_NORM2_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_NORM2_DISPATCH_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_NORM1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_MEAN_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_SQUARED_NORM2_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_SQRT_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_FILL_IN_MATRIX_DATA_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_CONVERT_TO_COO_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_CONVERT_TO_CSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_CONVERT_TO_ELL_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_CONVERT_TO_FBCSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_CONVERT_TO_HYBRID_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_CONVERT_TO_SELLP_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_CONVERT_TO_SPARSITY_CSR_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_MAX_NNZ_PER_ROW_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_COMPUTE_SLICE_SETS_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_COUNT_NONZEROS_PER_ROW_KERNEL); -GKO_INSTANTIATE_FOR_EACH_VALUE_TYPE( - GKO_DECLARE_DENSE_COUNT_NONZEROS_PER_ROW_KERNEL_SIZE_T); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_DENSE_COUNT_NONZERO_BLOCKS_PER_ROW_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_CONJ_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_SYMM_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_INV_SYMM_PERMUTE_KERNEL); -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE_2(GKO_DECLARE_DENSE_ROW_GATHER_KERNEL); -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE_2( - GKO_DECLARE_DENSE_ADVANCED_ROW_GATHER_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_COL_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_INV_ROW_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_INV_COL_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_NONSYMM_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_INV_NONSYMM_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_SYMM_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_INV_SYMM_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_ROW_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_COL_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_INV_ROW_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_INV_COL_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DENSE_NONSYMM_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_DENSE_INV_NONSYMM_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DENSE_EXTRACT_DIAGONAL_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_INPLACE_ABSOLUTE_DENSE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_OUTPLACE_ABSOLUTE_DENSE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_MAKE_COMPLEX_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GET_REAL_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GET_IMAG_KERNEL); - - -} // namespace dense - - -namespace diagonal { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DIAGONAL_APPLY_TO_DENSE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DIAGONAL_RIGHT_APPLY_TO_DENSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DIAGONAL_APPLY_TO_CSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DIAGONAL_RIGHT_APPLY_TO_CSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DIAGONAL_CONVERT_TO_CSR_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_DIAGONAL_CONJ_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_DIAGONAL_FILL_IN_MATRIX_DATA_KERNEL); - - -} // namespace diagonal - - -namespace batch_bicgstab { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_BICGSTAB_APPLY_KERNEL); - - -} // namespace batch_bicgstab - - -namespace batch_cg { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BATCH_CG_APPLY_KERNEL); - - -} // namespace batch_cg - - -namespace cg { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CG_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CG_STEP_1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CG_STEP_2_KERNEL); - - -} // namespace cg - - -namespace bicg { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICG_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICG_STEP_1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICG_STEP_2_KERNEL); - - -} // namespace bicg - - -namespace lower_trs { - - -GKO_STUB(GKO_DECLARE_LOWER_TRS_SHOULD_PERFORM_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_LOWER_TRS_GENERATE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_LOWER_TRS_SOLVE_KERNEL); - - -} // namespace lower_trs - - -namespace upper_trs { - - -GKO_STUB(GKO_DECLARE_UPPER_TRS_SHOULD_PERFORM_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_UPPER_TRS_GENERATE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_UPPER_TRS_SOLVE_KERNEL); - - -} // namespace upper_trs - - -namespace fcg { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_FCG_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_FCG_STEP_1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_FCG_STEP_2_KERNEL); - - -} // namespace fcg - - -namespace bicgstab { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICGSTAB_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICGSTAB_STEP_1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICGSTAB_STEP_2_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICGSTAB_STEP_3_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_BICGSTAB_FINALIZE_KERNEL); - - -} // namespace bicgstab - - -namespace idr { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_IDR_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_IDR_STEP_1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_IDR_STEP_2_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_IDR_STEP_3_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_IDR_COMPUTE_OMEGA_KERNEL); - - -} // namespace idr - - -namespace cgs { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CGS_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CGS_STEP_1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CGS_STEP_2_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CGS_STEP_3_KERNEL); - - -} // namespace cgs - -namespace gcr { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GCR_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GCR_RESTART_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GCR_STEP_1_KERNEL); - - -} // namespace gcr - -namespace common_gmres { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_COMMON_GMRES_INITIALIZE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_COMMON_GMRES_HESSENBERG_QR_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_COMMON_GMRES_SOLVE_KRYLOV_KERNEL); - - -} // namespace common_gmres - - -namespace gmres { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GMRES_RESTART_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GMRES_MULTI_AXPY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_GMRES_MULTI_DOT_KERNEL); - - -} // namespace gmres - - -namespace cb_gmres { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_CB_GMRES_INITIALIZE_KERNEL); -GKO_STUB_CB_GMRES(GKO_DECLARE_CB_GMRES_RESTART_KERNEL); -GKO_STUB_CB_GMRES(GKO_DECLARE_CB_GMRES_ARNOLDI_KERNEL); -GKO_STUB_CB_GMRES_CONST(GKO_DECLARE_CB_GMRES_SOLVE_KRYLOV_KERNEL); - - -} // namespace cb_gmres - - -namespace ir { - - -GKO_STUB(GKO_DECLARE_IR_INITIALIZE_KERNEL); - - -} // namespace ir - - -namespace multigrid { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_MULTIGRID_KCYCLE_STEP_1_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_MULTIGRID_KCYCLE_STEP_2_KERNEL); -GKO_STUB_NON_COMPLEX_VALUE_TYPE(GKO_DECLARE_MULTIGRID_KCYCLE_CHECK_STOP_KERNEL); - - -} // namespace multigrid - - -namespace sparsity_csr { - - -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SPARSITY_CSR_SPMV_KERNEL); -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_SPARSITY_CSR_ADVANCED_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SPARSITY_CSR_FILL_IN_DENSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_SPARSITY_CSR_DIAGONAL_ELEMENT_PREFIX_SUM_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_SPARSITY_CSR_REMOVE_DIAGONAL_ELEMENTS_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SPARSITY_CSR_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SPARSITY_CSR_SORT_BY_COLUMN_INDEX); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_SPARSITY_CSR_IS_SORTED_BY_COLUMN_INDEX); - - -} // namespace sparsity_csr - - -namespace csr { - - -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_SPMV_KERNEL); -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_ADVANCED_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_SPGEMM_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_ADVANCED_SPGEMM_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_SPGEAM_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_FILL_IN_DENSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_CONVERT_TO_ELL_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_CONVERT_TO_FBCSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_CONVERT_TO_HYBRID_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_CONVERT_TO_SELLP_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_CONJ_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_NONSYMM_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_SYMM_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_ROW_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_COL_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_ROW_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_NONSYMM_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_SYMM_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_ROW_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_COL_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_ROW_SCALE_PERMUTE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_SORT_BY_COLUMN_INDEX); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_IS_SORTED_BY_COLUMN_INDEX); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_EXTRACT_DIAGONAL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_CALC_NNZ_PER_ROW_IN_SPAN_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_CSR_CALC_NNZ_PER_ROW_IN_INDEX_SET_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_COMPUTE_SUB_MATRIX_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_CHECK_DIAGONAL_ENTRIES_EXIST); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_ADD_SCALED_IDENTITY_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_CSR_COMPUTE_SUB_MATRIX_FROM_INDEX_SET_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_CSR_BUILD_LOOKUP_OFFSETS_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_CSR_BUILD_LOOKUP_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_CSR_BENCHMARK_LOOKUP_KERNEL); - -template -GKO_DECLARE_CSR_SCALE_KERNEL(ValueType, IndexType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_SCALE_KERNEL); - -template -GKO_DECLARE_CSR_INV_SCALE_KERNEL(ValueType, IndexType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CSR_INV_SCALE_KERNEL); - - -} // namespace csr - - -namespace fbcsr { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_ADVANCED_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_FILL_IN_MATRIX_DATA_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_FILL_IN_DENSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_CONVERT_TO_CSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_CONJ_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_IS_SORTED_BY_COLUMN_INDEX); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_SORT_BY_COLUMN_INDEX); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FBCSR_EXTRACT_DIAGONAL); - - -} // namespace fbcsr - - -namespace coo { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_COO_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_COO_ADVANCED_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_COO_SPMV2_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_COO_ADVANCED_SPMV2_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_COO_FILL_IN_DENSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_COO_EXTRACT_DIAGONAL_KERNEL); - - -} // namespace coo - - -namespace ell { - - -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_SPMV_KERNEL); -GKO_STUB_MIXED_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_ADVANCED_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_FILL_IN_MATRIX_DATA_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_ELL_COMPUTE_MAX_ROW_NNZ_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_FILL_IN_DENSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_COPY_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_CONVERT_TO_CSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_COUNT_NONZEROS_PER_ROW_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ELL_EXTRACT_DIAGONAL_KERNEL); - - -} // namespace ell - - -namespace fft { - - -template -GKO_DECLARE_FFT_KERNEL(ValueType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE(GKO_DECLARE_FFT_KERNEL); - -template -GKO_DECLARE_FFT2_KERNEL(ValueType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE(GKO_DECLARE_FFT2_KERNEL); - -template -GKO_DECLARE_FFT3_KERNEL(ValueType) -GKO_NOT_COMPILED(GKO_HOOK_MODULE); -GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE(GKO_DECLARE_FFT3_KERNEL); - - -} // namespace fft - - -namespace hybrid { - - -GKO_STUB(GKO_DECLARE_HYBRID_COMPUTE_COO_ROW_PTRS_KERNEL); -GKO_STUB(GKO_DECLARE_HYBRID_COMPUTE_ROW_NNZ); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_HYBRID_FILL_IN_MATRIX_DATA_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_HYBRID_CONVERT_TO_CSR_KERNEL); - - -} // namespace hybrid - - -namespace permutation { - - -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PERMUTATION_INVERT_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PERMUTATION_COMPOSE_KERNEL); - - -} // namespace permutation - - -namespace scaled_permutation { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SCALED_PERMUTATION_INVERT_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SCALED_PERMUTATION_COMPOSE_KERNEL); - - -} // namespace scaled_permutation - - -namespace sellp { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SELLP_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SELLP_FILL_IN_MATRIX_DATA_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_SELLP_COMPUTE_SLICE_SETS_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SELLP_ADVANCED_SPMV_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SELLP_FILL_IN_DENSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SELLP_CONVERT_TO_CSR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SELLP_COUNT_NONZEROS_PER_ROW_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_SELLP_EXTRACT_DIAGONAL_KERNEL); - - -} // namespace sellp - - -namespace batch_jacobi { - - -GKO_STUB_INDEX_TYPE( - GKO_DECLARE_BATCH_BLOCK_JACOBI_COMPUTE_CUMULATIVE_BLOCK_STORAGE); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_BATCH_BLOCK_JACOBI_FIND_ROW_BLOCK_MAP); -GKO_STUB_VALUE_AND_INT32_TYPE( - GKO_DECLARE_BATCH_BLOCK_JACOBI_EXTRACT_PATTERN_KERNEL); -GKO_STUB_VALUE_AND_INT32_TYPE(GKO_DECLARE_BATCH_BLOCK_JACOBI_COMPUTE_KERNEL); - - -} // namespace batch_jacobi - - -namespace jacobi { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_JACOBI_FIND_BLOCKS_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_JACOBI_GENERATE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_JACOBI_APPLY_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_JACOBI_SIMPLE_APPLY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_JACOBI_SCALAR_APPLY_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_JACOBI_SIMPLE_SCALAR_APPLY_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_JACOBI_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_JACOBI_CONJ_TRANSPOSE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_JACOBI_SCALAR_CONVERT_TO_DENSE_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_JACOBI_SCALAR_CONJ_KERNEL); -GKO_STUB_VALUE_TYPE(GKO_DECLARE_JACOBI_INVERT_DIAGONAL_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_JACOBI_CONVERT_TO_DENSE_KERNEL); -GKO_STUB(GKO_DECLARE_JACOBI_INITIALIZE_PRECISIONS_KERNEL); - - -} // namespace jacobi - - -namespace isai { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ISAI_GENERATE_TRI_INVERSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ISAI_GENERATE_GENERAL_INVERSE_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ISAI_GENERATE_EXCESS_SYSTEM_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ISAI_SCALE_EXCESS_SOLUTION_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ISAI_SCATTER_EXCESS_SOLUTION_KERNEL); - - -} // namespace isai - - -namespace cholesky { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CHOLESKY_SYMBOLIC_COUNT); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CHOLESKY_SYMBOLIC_FACTORIZE); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CHOLESKY_FOREST_FROM_FACTOR); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CHOLESKY_INITIALIZE); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_CHOLESKY_FACTORIZE); - - -} // namespace cholesky - - -namespace factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_FACTORIZATION_ADD_DIAGONAL_ELEMENTS_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_FACTORIZATION_INITIALIZE_ROW_PTRS_L_U_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FACTORIZATION_INITIALIZE_L_U_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_FACTORIZATION_INITIALIZE_ROW_PTRS_L_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_FACTORIZATION_INITIALIZE_L_KERNEL); - - -} // namespace factorization - - -namespace ic_factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_IC_COMPUTE_KERNEL); - - -} // namespace ic_factorization - - -namespace ilu_factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ILU_COMPUTE_LU_KERNEL); - - -} // namespace ilu_factorization - - -namespace lu_factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_LU_INITIALIZE); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_LU_FACTORIZE); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_LU_SYMMETRIC_FACTORIZE_SIMPLE); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_LU_SYMMETRIC_FACTORIZE_SIMPLE_FINALIZE); - - -} // namespace lu_factorization - - -namespace par_ic_factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_IC_INIT_FACTOR_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_IC_COMPUTE_FACTOR_KERNEL); - - -} // namespace par_ic_factorization - - -namespace par_ict_factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_ICT_ADD_CANDIDATES_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_ICT_COMPUTE_FACTOR_KERNEL); - - -} // namespace par_ict_factorization - - -namespace par_ilu_factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_ILU_COMPUTE_L_U_FACTORS_KERNEL); - - -} // namespace par_ilu_factorization - - -namespace par_ilut_factorization { - - -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_ILUT_ADD_CANDIDATES_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_ILUT_COMPUTE_LU_FACTORS_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_ILUT_THRESHOLD_SELECT_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PAR_ILUT_THRESHOLD_FILTER_KERNEL); -GKO_STUB_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_PAR_ILUT_THRESHOLD_FILTER_APPROX_KERNEL); - - -} // namespace par_ilut_factorization - - -namespace rcm { - - -GKO_STUB_INDEX_TYPE(GKO_DECLARE_RCM_COMPUTE_PERMUTATION_KERNEL); - - -} // namespace rcm - - -namespace pgm { - - -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_MATCH_EDGE_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_COUNT_UNAGG_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_RENUMBER_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_SORT_AGG_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_MAP_ROW_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_MAP_COL_KERNEL); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_COUNT_UNREPEATED_NNZ_KERNEL); -GKO_STUB_NON_COMPLEX_VALUE_AND_INDEX_TYPE( - GKO_DECLARE_PGM_FIND_STRONGEST_NEIGHBOR); -GKO_STUB_NON_COMPLEX_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PGM_ASSIGN_TO_EXIST_AGG); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PGM_SORT_ROW_MAJOR); -GKO_STUB_VALUE_AND_INDEX_TYPE(GKO_DECLARE_PGM_COMPUTE_COARSE_COO); -GKO_STUB_INDEX_TYPE(GKO_DECLARE_PGM_GATHER_INDEX); - - -} // namespace pgm - - -namespace set_all_statuses { - - -GKO_STUB(GKO_DECLARE_SET_ALL_STATUSES_KERNEL); - - -} // namespace set_all_statuses - - -namespace residual_norm { - - -GKO_STUB_NON_COMPLEX_VALUE_TYPE(GKO_DECLARE_RESIDUAL_NORM_KERNEL); - - -} // namespace residual_norm - - -namespace implicit_residual_norm { - - -GKO_STUB_VALUE_TYPE(GKO_DECLARE_IMPLICIT_RESIDUAL_NORM_KERNEL); - - -} // namespace implicit_residual_norm -} // namespace GKO_HOOK_MODULE -} // namespace kernels -} // namespace gko diff --git a/core/device_hooks/cuda_hooks.cpp b/core/device_hooks/cuda_hooks.cpp index 4124ac2bea5..75f79b3a836 100644 --- a/core/device_hooks/cuda_hooks.cpp +++ b/core/device_hooks/cuda_hooks.cpp @@ -257,8 +257,3 @@ void end_nvtx(const char*, profile_event_category) GKO_NOT_COMPILED(cuda); } // namespace log } // namespace gko - - -#define GKO_HOOK_MODULE cuda -#include "core/device_hooks/common_kernels.inc.cpp" -#undef GKO_HOOK_MODULE diff --git a/core/device_hooks/dpcpp_hooks.cpp b/core/device_hooks/dpcpp_hooks.cpp index 470fd9befc4..383cc319565 100644 --- a/core/device_hooks/dpcpp_hooks.cpp +++ b/core/device_hooks/dpcpp_hooks.cpp @@ -150,8 +150,3 @@ std::chrono::nanoseconds DpcppTimer::difference_async(const time_point& start, } // namespace gko - - -#define GKO_HOOK_MODULE dpcpp -#include "core/device_hooks/common_kernels.inc.cpp" -#undef GKO_HOOK_MODULE diff --git a/core/device_hooks/hip_hooks.cpp b/core/device_hooks/hip_hooks.cpp index 7f3497e8020..8b249d43b2e 100644 --- a/core/device_hooks/hip_hooks.cpp +++ b/core/device_hooks/hip_hooks.cpp @@ -252,8 +252,3 @@ void end_roctx(const char*, profile_event_category) GKO_NOT_COMPILED(hip); } // namespace log } // namespace gko - - -#define GKO_HOOK_MODULE hip -#include "core/device_hooks/common_kernels.inc.cpp" -#undef GKO_HOOK_MODULE diff --git a/core/device_hooks/omp_hooks.cpp b/core/device_hooks/omp_hooks.cpp index 33025006a4d..5a920272a31 100644 --- a/core/device_hooks/omp_hooks.cpp +++ b/core/device_hooks/omp_hooks.cpp @@ -31,8 +31,3 @@ int OmpExecutor::get_num_omp_threads() { return 1; } } // namespace gko - - -#define GKO_HOOK_MODULE omp -#include "core/device_hooks/common_kernels.inc.cpp" -#undef GKO_HOOK_MODULE diff --git a/core/device_hooks/reference_hooks.cpp b/core/device_hooks/reference_hooks.cpp index 8293642eff9..bb88f8111ab 100644 --- a/core/device_hooks/reference_hooks.cpp +++ b/core/device_hooks/reference_hooks.cpp @@ -24,8 +24,3 @@ scoped_device_id_guard::scoped_device_id_guard(const ReferenceExecutor* exec, } // namespace gko - - -#define GKO_HOOK_MODULE reference -#include "core/device_hooks/common_kernels.inc.cpp" -#undef GKO_HOOK_MODULE From f3ab998e45f3121eaa629fbce30b397f81762573 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 16 Oct 2024 13:40:07 +0000 Subject: [PATCH 3/4] [core] adds more specific exception message --- .../ginkgo/core/base/exception_helpers.hpp | 19 ++++++ include/ginkgo/core/base/executor.hpp | 68 ++++++++++++------- 2 files changed, 61 insertions(+), 26 deletions(-) diff --git a/include/ginkgo/core/base/exception_helpers.hpp b/include/ginkgo/core/base/exception_helpers.hpp index f0104ba1a7c..2c4cb7f0443 100644 --- a/include/ginkgo/core/base/exception_helpers.hpp +++ b/include/ginkgo/core/base/exception_helpers.hpp @@ -61,6 +61,25 @@ namespace gko { "semi-colon warnings") +/** + * Marks a kernel as not compiled. + * + * The same behavior as GKO_NOT_COMPILED, except that the kernel name is + * explicitly specified, instead of based on the __func__ macro. + * + * @param _module the module which should be compiled to enable the kernel + * @param _kernel the name of the kernel + */ +#define GKO_KERNEL_NOT_COMPILED(_module, _kernel) \ + { \ + throw ::gko::NotCompiled(__FILE__, __LINE__, _kernel, \ + GKO_QUOTE(_module)); \ + } \ + static_assert(true, \ + "This assert is used to counter the false positive extra " \ + "semi-colon warnings") + + namespace detail { diff --git a/include/ginkgo/core/base/executor.hpp b/include/ginkgo/core/base/executor.hpp index a2718318ffa..c82baa52d34 100644 --- a/include/ginkgo/core/base/executor.hpp +++ b/include/ginkgo/core/base/executor.hpp @@ -424,52 +424,68 @@ RegisteredOperation make_register_operation(const char* name, return ::gko::detail::make_register_operation( \ #_kernel, [&args...](auto exec) { \ using exec_type = decltype(exec); \ - if constexpr (::gko::ginkgo_build_reference_v && \ - std::is_same< \ + if constexpr (std::is_same< \ exec_type, \ std::shared_ptr< \ const ::gko::ReferenceExecutor>>:: \ value) { \ - ::gko::kernels::reference::_kernel( \ - std::dynamic_pointer_cast< \ - const ::gko::ReferenceExecutor>(exec), \ - std::forward(args)...); \ + if constexpr (::gko::ginkgo_build_reference_v) { \ + ::gko::kernels::reference::_kernel( \ + std::dynamic_pointer_cast< \ + const ::gko::ReferenceExecutor>(exec), \ + std::forward(args)...); \ + } else { \ + GKO_KERNEL_NOT_COMPILED(reference, #_kernel); \ + } \ } else if constexpr ( \ - ::gko::ginkgo_build_omp_v && \ std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - ::gko::kernels::omp::_kernel( \ - std::dynamic_pointer_cast( \ - exec), \ - std::forward(args)...); \ + if constexpr (::gko::ginkgo_build_omp_v) { \ + ::gko::kernels::omp::_kernel( \ + std::dynamic_pointer_cast< \ + const ::gko::OmpExecutor>(exec), \ + std::forward(args)...); \ + } else { \ + GKO_KERNEL_NOT_COMPILED(omp, #_kernel); \ + } \ } else if constexpr ( \ - ::gko::ginkgo_build_cuda_v && \ std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - ::gko::kernels::cuda::_kernel( \ - std::dynamic_pointer_cast( \ - exec), \ - std::forward(args)...); \ + if constexpr (::gko::ginkgo_build_cuda_v) { \ + ::gko::kernels::cuda::_kernel( \ + std::dynamic_pointer_cast< \ + const ::gko::CudaExecutor>(exec), \ + std::forward(args)...); \ + } else { \ + GKO_KERNEL_NOT_COMPILED(cuda, #_kernel); \ + } \ } else if constexpr ( \ - ::gko::ginkgo_build_hip_v && \ std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - ::gko::kernels::hip::_kernel( \ - std::dynamic_pointer_cast( \ - exec), \ - std::forward(args)...); \ + if constexpr (::gko::ginkgo_build_hip_v) { \ + ::gko::kernels::hip::_kernel( \ + std::dynamic_pointer_cast< \ + const ::gko::HipExecutor>(exec), \ + std::forward(args)...); \ + } else { \ + GKO_KERNEL_NOT_COMPILED(hip, #_kernel); \ + } \ } else if constexpr ( \ - ::gko::ginkgo_build_sycl_v && \ std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - ::gko::kernels::dpcpp::_kernel( \ - std::dynamic_pointer_cast( \ - exec), \ - std::forward(args)...); \ + if constexpr (::gko::ginkgo_build_sycl_v) { \ + ::gko::kernels::dpcpp::_kernel( \ + std::dynamic_pointer_cast< \ + const ::gko::DpcppExecutor>(exec), \ + std::forward(args)...); \ + } else { \ + GKO_KERNEL_NOT_COMPILED(sycl, #_kernel); \ + } \ + \ } else { \ GKO_NOT_IMPLEMENTED; \ } \ From e7812437e34836930731b66bb8e1871f9152c70a Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 16 Oct 2024 13:49:34 +0000 Subject: [PATCH 4/4] [core] adds more specific exception message --- include/ginkgo/config.hpp.in | 13 ------------- include/ginkgo/core/base/executor.hpp | 10 +++++----- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/include/ginkgo/config.hpp.in b/include/ginkgo/config.hpp.in index 746eea8adfd..d76fdc57a72 100644 --- a/include/ginkgo/config.hpp.in +++ b/include/ginkgo/config.hpp.in @@ -99,19 +99,6 @@ // clang-format on -namespace gko{ - -/* Provide non-macro access to which backends are available. */ -constexpr bool ginkgo_build_cuda_v = GINKGO_BUILD_CUDA; -constexpr bool ginkgo_build_hip_v = GINKGO_BUILD_HIP; -constexpr bool ginkgo_build_omp_v = GINKGO_BUILD_OMP; -constexpr bool ginkgo_build_reference_v = GINKGO_BUILD_REFERENCE; -constexpr bool ginkgo_build_sycl_v = GINKGO_BUILD_SYCL; - - -} - - /* Is MPI available ? */ // clang-format off #cmakedefine01 GINKGO_BUILD_MPI diff --git a/include/ginkgo/core/base/executor.hpp b/include/ginkgo/core/base/executor.hpp index c82baa52d34..53444b49131 100644 --- a/include/ginkgo/core/base/executor.hpp +++ b/include/ginkgo/core/base/executor.hpp @@ -429,7 +429,7 @@ RegisteredOperation make_register_operation(const char* name, std::shared_ptr< \ const ::gko::ReferenceExecutor>>:: \ value) { \ - if constexpr (::gko::ginkgo_build_reference_v) { \ + if constexpr (GINKGO_BUILD_REFERENCE) { \ ::gko::kernels::reference::_kernel( \ std::dynamic_pointer_cast< \ const ::gko::ReferenceExecutor>(exec), \ @@ -441,7 +441,7 @@ RegisteredOperation make_register_operation(const char* name, std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - if constexpr (::gko::ginkgo_build_omp_v) { \ + if constexpr (GINKGO_BUILD_OMP) { \ ::gko::kernels::omp::_kernel( \ std::dynamic_pointer_cast< \ const ::gko::OmpExecutor>(exec), \ @@ -453,7 +453,7 @@ RegisteredOperation make_register_operation(const char* name, std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - if constexpr (::gko::ginkgo_build_cuda_v) { \ + if constexpr (GINKGO_BUILD_CUDA) { \ ::gko::kernels::cuda::_kernel( \ std::dynamic_pointer_cast< \ const ::gko::CudaExecutor>(exec), \ @@ -465,7 +465,7 @@ RegisteredOperation make_register_operation(const char* name, std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - if constexpr (::gko::ginkgo_build_hip_v) { \ + if constexpr (GINKGO_BUILD_HIP) { \ ::gko::kernels::hip::_kernel( \ std::dynamic_pointer_cast< \ const ::gko::HipExecutor>(exec), \ @@ -477,7 +477,7 @@ RegisteredOperation make_register_operation(const char* name, std::is_same< \ exec_type, \ std::shared_ptr>::value) { \ - if constexpr (::gko::ginkgo_build_sycl_v) { \ + if constexpr (GINKGO_BUILD_SYCL) { \ ::gko::kernels::dpcpp::_kernel( \ std::dynamic_pointer_cast< \ const ::gko::DpcppExecutor>(exec), \