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

DRAFT: Remove runtime type selection #187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions include/aggregation/selectors/adaptive.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ class AdaptiveSelectorBase: public Selector<T_Config>
typedef typename Matrix<TConfig>::MVector MVector;

//typedefs for the weight matrix and vectors
typedef TemplateMode<AMGX_mode_dFFI>::Type TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef TemplateConfig<AMGX_device, AMGX_vecFloat, AMGX_matFloat, AMGX_indInt> TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef typename TConfig_dFFI::template setVecPrec<AMGX_vecInt>::Type ivec_value_type_dFFI;
typedef Vector<ivec_value_type_dFFI> IVector_dFFI;
typedef Vector<TConfig_dFFI> VVector_dFFI;


AdaptiveSelectorBase(AMG_Config &cfg, const std::string &cfg_scope);
void setAggregates( Matrix<T_Config> &A,
IVector &aggregates, IVector &aggregates_global, int &num_aggregates);
Expand All @@ -80,7 +79,7 @@ class AdaptiveSelector<TemplateConfig<AMGX_host, t_vecPrec, t_matPrec, t_indPrec
typedef typename Matrix_h::MVector MVector;

//typedefs for the weight matrix and vectors
typedef TemplateMode<AMGX_mode_dFFI>::Type TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef TemplateConfig<AMGX_device, AMGX_vecFloat, AMGX_matFloat, AMGX_indInt> TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef typename TConfig_dFFI::template setVecPrec<AMGX_vecInt>::Type ivec_value_type_dFFI;
typedef Vector<ivec_value_type_dFFI> IVector_dFFI;
typedef Vector<TConfig_dFFI> VVector_dFFI;
Expand Down
2 changes: 1 addition & 1 deletion include/aggregation/selectors/geo_selector.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GEO_SelectorBase: public Selector<T_Config>
typedef typename Matrix<T_Config>::IVector IVector;
typedef typename Matrix<T_Config>::MVector VVector;
typedef typename TConfig::template setMemSpace<AMGX_host>::Type TConfig_h;
typedef Vector<typename TConfig_h::template setVecPrec<(AMGX_VecPrecision)AMGX_GET_MODE_VAL(AMGX_MatPrecision, TConfig_h::mode)>::Type> Vector_h; // host vector with Matrix precision
typedef Vector<typename TConfig_h::template setVecPrec<(AMGX_VecPrecision)AMGX_MatPrec>::Type> Vector_h; // host vector with Matrix precision
typedef typename Vector_h::value_type value_type;

GEO_SelectorBase(AMG_Config &cfg, const std::string &cfg_scope);
Expand Down
6 changes: 3 additions & 3 deletions include/aggregation/selectors/multi_pairwise.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MultiPairwiseSelectorBase: public Selector<T_Config>
typedef typename Matrix<TConfig>::MVector MVector;

//typedefs for the weight matrix and vectors
typedef TemplateMode<AMGX_mode_dFFI>::Type TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef TemplateConfig<AMGX_device, AMGX_vecFloat, AMGX_matFloat, AMGX_indInt> TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef typename TConfig_dFFI::template setVecPrec<AMGX_vecInt>::Type ivec_value_type_dFFI;
typedef Vector<ivec_value_type_dFFI> IVector_dFFI;
typedef Vector<TConfig_dFFI> VVector_dFFI;
Expand Down Expand Up @@ -110,7 +110,7 @@ class MultiPairwiseSelector<TemplateConfig<AMGX_host, t_vecPrec, t_matPrec, t_in
typedef typename Matrix_h::MVector MVector;

//typedefs for the weight matrix and vectors
typedef TemplateMode<AMGX_mode_dFFI>::Type TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef TemplateConfig<AMGX_device, AMGX_vecFloat, AMGX_matFloat, AMGX_indInt> TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef typename TConfig_dFFI::template setVecPrec<AMGX_vecInt>::Type ivec_value_type_dFFI;
typedef Vector<ivec_value_type_dFFI> IVector_dFFI;
typedef Vector<TConfig_dFFI> VVector_dFFI;
Expand Down Expand Up @@ -144,7 +144,7 @@ class MultiPairwiseSelector<TemplateConfig<AMGX_device, t_vecPrec, t_matPrec, t_
typedef typename Matrix_d::MVector MVector;

//typedefs for the weight matrix and vectors
typedef TemplateMode<AMGX_mode_dFFI>::Type TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef TemplateConfig<AMGX_device, AMGX_vecFloat, AMGX_matFloat, AMGX_indInt> TConfig_dFFI;//possible issue: the indextype does not match the actual indextype
typedef typename TConfig_dFFI::template setVecPrec<AMGX_vecInt>::Type ivec_value_type_dFFI;
typedef Vector<ivec_value_type_dFFI> IVector_dFFI;
typedef Vector<TConfig_dFFI> VVector_dFFI;
Expand Down
4 changes: 2 additions & 2 deletions include/aggregation/selectors/size8_selector.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Size8Selector<TemplateConfig<AMGX_host, t_vecPrec, t_matPrec, t_indPrec> >
typedef typename Matrix_h::IVector IVector;
typedef typename Matrix<TConfig>::MVector VVector;
typedef typename TConfig::template setMemSpace<AMGX_host>::Type TConfig_h;
typedef Vector<typename TConfig_h::template setVecPrec<(AMGX_VecPrecision)AMGX_GET_MODE_VAL(AMGX_MatPrecision, TConfig_h::mode)>::Type> Vector_h; // host vector with Matrix precision
typedef Vector<typename TConfig_h::template setVecPrec<(AMGX_VecPrecision)AMGX_MatPrec>::Type> Vector_h; // host vector with Matrix precision

Size8Selector(AMG_Config &cfg, const std::string &cfg_scope) : Size8SelectorBase<TConfig>(cfg, cfg_scope) {}
private:
Expand All @@ -97,7 +97,7 @@ class Size8Selector<TemplateConfig<AMGX_device, t_vecPrec, t_matPrec, t_indPrec>
typedef typename Matrix_d::IVector IVector;
typedef typename Matrix<TConfig>::MVector VVector;
typedef typename TConfig::template setMemSpace<AMGX_host>::Type TConfig_h;
typedef Vector<typename TConfig_h::template setVecPrec<(AMGX_VecPrecision)AMGX_GET_MODE_VAL(AMGX_MatPrecision, TConfig_h::mode)>::Type> Vector_h; // host vector with Matrix precision
typedef Vector<typename TConfig_h::template setVecPrec<(AMGX_VecPrecision)AMGX_MatPrec>::Type> Vector_h; // host vector with Matrix precision
Size8Selector(AMG_Config &cfg, const std::string &cfg_scope) : Size8SelectorBase<TConfig>(cfg, cfg_scope) {}
public:
void setAggregates_common_sqblock(const Matrix_d &A,
Expand Down
12 changes: 2 additions & 10 deletions include/amgx_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ AMGX_RC AMGX_API AMGX_distribution_set_32bit_colindices
/* Matrix */
AMGX_RC AMGX_API AMGX_matrix_create
(AMGX_matrix_handle *mtx,
AMGX_resources_handle rsc,
AMGX_Mode mode);
AMGX_resources_handle rsc);

AMGX_RC AMGX_API AMGX_matrix_destroy
(AMGX_matrix_handle mtx);
Expand Down Expand Up @@ -358,8 +357,7 @@ AMGX_RC AMGX_API AMGX_matrix_comm_from_maps_one_ring
/* Vector */
AMGX_RC AMGX_API AMGX_vector_create
(AMGX_vector_handle *vec,
AMGX_resources_handle rsc,
AMGX_Mode mode);
AMGX_resources_handle rsc);

AMGX_RC AMGX_API AMGX_vector_destroy
(AMGX_vector_handle vec);
Expand Down Expand Up @@ -396,7 +394,6 @@ AMGX_RC AMGX_API AMGX_vector_bind
AMGX_RC AMGX_API AMGX_solver_create
(AMGX_solver_handle *slv,
AMGX_resources_handle rsc,
AMGX_Mode mode,
const AMGX_config_handle cfg_solver);

AMGX_RC AMGX_API AMGX_solver_destroy
Expand Down Expand Up @@ -490,7 +487,6 @@ AMGX_RC AMGX_API AMGX_read_system_maps_one_ring
int **recv_sizes,
int ***recv_maps,
AMGX_resources_handle rsc,
AMGX_Mode mode,
const char *filename,
int allocated_halo_depth,
int num_partitions,
Expand All @@ -516,7 +512,6 @@ AMGX_RC AMGX_API AMGX_generate_distributed_poisson_7pt
(AMGX_matrix_handle mtx,
AMGX_vector_handle rhs,
AMGX_vector_handle sol,
int allocated_halo_depth,
int num_import_rings,
int nx,
int ny,
Expand Down Expand Up @@ -557,7 +552,6 @@ AMGX_RC AMGX_API AMGX_read_system_global
void **rhs,
void **sol,
AMGX_resources_handle rsc,
AMGX_Mode mode,
const char *filename,
int allocated_halo_depth,
int num_partitions,
Expand All @@ -576,7 +570,6 @@ AMGX_RC AMGX_API AMGX_matrix_upload_all_global
const void *col_indices_global,
const void *data,
const void *diag_data,
int allocated_halo_depth,
int num_import_rings,
const int *partition_vector);

Expand All @@ -591,7 +584,6 @@ AMGX_RC AMGX_API AMGX_matrix_upload_all_global_32
const void *col_indices_global,
const void *data,
const void *diag_data,
int allocated_halo_depth,
int num_import_rings,
const int *partition_vector);

Expand Down
Loading