-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
87 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors | ||
// | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#ifndef GKO_CORE_CONFIG_PARSE_MARCO_HPP_ | ||
#define GKO_CORE_CONFIG_PARSE_MARCO_HPP_ | ||
|
||
|
||
#include <ginkgo/core/config/config.hpp> | ||
#include <ginkgo/core/config/registry.hpp> | ||
#include <ginkgo/core/config/type_descriptor.hpp> | ||
|
||
|
||
#include "core/config/config_helper.hpp" | ||
#include "core/config/dispatch.hpp" | ||
#include "core/config/type_descriptor_helper.hpp" | ||
|
||
|
||
// for value_type only | ||
#define PARSE_VALUE_TYPE(_type, _configurator) \ | ||
template <> \ | ||
deferred_factory_parameter<gko::LinOpFactory> \ | ||
parse<gko::config::LinOpFactoryType::_type>( \ | ||
const gko::config::pnode& config, \ | ||
const gko::config::registry& context, \ | ||
const gko::config::type_descriptor& td) \ | ||
{ \ | ||
auto updated = gko::config::update_type(config, td); \ | ||
return gko::config::dispatch<gko::LinOpFactory, _configurator>( \ | ||
config, context, updated, \ | ||
gko::config::make_type_selector(updated.get_value_typestr(), \ | ||
gko::config::value_type_list())); \ | ||
} \ | ||
static_assert(true, \ | ||
"This assert is used to counter the false positive extra " \ | ||
"semi-colon warnings") | ||
|
||
|
||
// for value_type and index_type | ||
#define PARSE_VALUE_AND_INDEX_TYPE(_type, _configurator) \ | ||
template <> \ | ||
deferred_factory_parameter<gko::LinOpFactory> \ | ||
parse<gko::config::LinOpFactoryType::_type>( \ | ||
const gko::config::pnode& config, \ | ||
const gko::config::registry& context, \ | ||
const gko::config::type_descriptor& td) \ | ||
{ \ | ||
auto updated = gko::config::update_type(config, td); \ | ||
return gko::config::dispatch<gko::LinOpFactory, _configurator>( \ | ||
config, context, updated, \ | ||
gko::config::make_type_selector(updated.get_value_typestr(), \ | ||
gko::config::value_type_list()), \ | ||
gko::config::make_type_selector(updated.get_index_typestr(), \ | ||
gko::config::index_type_list())); \ | ||
} \ | ||
static_assert(true, \ | ||
"This assert is used to counter the false positive extra " \ | ||
"semi-colon warnings") | ||
|
||
|
||
#endif // GKO_CORE_CONFIG_PARSE_MARCO_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters