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: Use span for vectors. #28

Merged
merged 2 commits into from
Apr 8, 2024
Merged
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
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage:
status:
project: off
patch: off
20 changes: 10 additions & 10 deletions raptor/core/comm_pkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "comm_pkg.hpp"
#include "par_matrix.hpp"
#include "utilities.hpp"

namespace raptor
{
Expand Down Expand Up @@ -57,7 +58,7 @@ namespace raptor

template<>
void CommPkg::communicate_T(const double* values,
std::vector<double>& result,
std::vector<double>& result,
const int block_size,
std::function<double(double, double)> result_func,
std::function<double(double, double)> init_result_func,
Expand All @@ -68,7 +69,7 @@ namespace raptor
}
template<>
void CommPkg::communicate_T(const double* values,
std::vector<int>& result,
std::vector<int>& result,
const int block_size,
std::function<int(int, double)> result_func,
std::function<double(double, double)> init_result_func,
Expand All @@ -79,7 +80,7 @@ namespace raptor
}
template<>
void CommPkg::communicate_T(const int* values,
std::vector<int>& result,
std::vector<int>& result,
const int block_size,
std::function<int(int, int)> result_func,
std::function<int(int, int)> init_result_func,
Expand All @@ -90,10 +91,10 @@ namespace raptor
}
template<>
void CommPkg::communicate_T(const int* values,
std::vector<double>& result,
std::vector<double>& result,
const int block_size,
std::function<double(double, int)> result_func,
std::function<int(int, int)> init_result_func,
std::function<int(int, int)> init_result_func,
int init_result_func_val)
{
init_int_comm_T(values, block_size, init_result_func, init_result_func_val);
Expand Down Expand Up @@ -136,7 +137,7 @@ namespace raptor
}

template<>
void CommPkg::complete_comm_T<double, double>(std::vector<double>& result,
void CommPkg::complete_comm_T<double, double>(span<double> result,
const int block_size,
std::function<double(double, double)> result_func,
std::function<double(double, double)> init_result_func,
Expand All @@ -145,7 +146,7 @@ namespace raptor
complete_double_comm_T(result, block_size, result_func, init_result_func, init_result_func_val);
}
template<>
void CommPkg::complete_comm_T<double, int>(std::vector<int>& result,
void CommPkg::complete_comm_T<double, int>(span<int> result,
const int block_size,
std::function<int(int, double)> result_func,
std::function<double(double, double)> init_result_func,
Expand All @@ -154,7 +155,7 @@ namespace raptor
complete_double_comm_T(result, block_size, result_func, init_result_func, init_result_func_val);
}
template<>
void CommPkg::complete_comm_T<int, int>(std::vector<int>& result,
void CommPkg::complete_comm_T<int, int>(span<int> result,
const int block_size,
std::function<int(int, int)> result_func,
std::function<int(int, int)> init_result_func,
Expand All @@ -163,7 +164,7 @@ namespace raptor
complete_int_comm_T(result, block_size, result_func, init_result_func, init_result_func_val);
}
template<>
void CommPkg::complete_comm_T<int, double>(std::vector<double>& result,
void CommPkg::complete_comm_T<int, double>(span<double> result,
const int block_size,
std::function<double(double, int)> result_func,
std::function<int(int, int)> init_result_func,
Expand Down Expand Up @@ -200,4 +201,3 @@ void CommPkg::init_comm(ParVector& v, const int block_size)
{
init_double_comm(v.local.data(), block_size);
}

Loading
Loading