Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
  • Loading branch information
ginkgo-bot and MarcelKoch committed May 4, 2022
1 parent 6afb2b8 commit 9abcb7f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions test/matrix/dense_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,9 +1340,9 @@ TEST_F(Dense, ComputeNorm2SquaredIsEquivalentToRef)
auto dnorm = NormVector::create(exec, norm_size);

gko::kernels::reference::dense::compute_squared_norm2(ref, x.get(),
norm_expected.get());
norm_expected.get());
gko::kernels::EXEC_NAMESPACE::dense::compute_squared_norm2(exec, dx.get(),
dnorm.get());
dnorm.get());

GKO_ASSERT_MTX_NEAR(dnorm, norm_expected, r<vtype>::value);
}
Expand Down
15 changes: 9 additions & 6 deletions test/mpi/distributed/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,15 @@ class HostToDeviceLogger : public gko::log::Logger {
template <typename ValueLocalGlobalIndexType>
class VectorCreation : public ::testing::Test {
public:
using value_type = typename std::tuple_element<
0, decltype(ValueLocalGlobalIndexType())>::type;
using local_index_type = typename std::tuple_element<
1, decltype(ValueLocalGlobalIndexType())>::type;
using global_index_type = typename std::tuple_element<
2, decltype(ValueLocalGlobalIndexType())>::type;
using value_type =
typename std::tuple_element<0, decltype(
ValueLocalGlobalIndexType())>::type;
using local_index_type =
typename std::tuple_element<1, decltype(
ValueLocalGlobalIndexType())>::type;
using global_index_type =
typename std::tuple_element<2, decltype(
ValueLocalGlobalIndexType())>::type;
using part_type =
gko::distributed::Partition<local_index_type, global_index_type>;
using md_type = gko::matrix_data<value_type, global_index_type>;
Expand Down
12 changes: 8 additions & 4 deletions test/utils/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ void init_executor(std::shared_ptr<gko::ReferenceExecutor> ref,
gko::mpi::communicator comm)
{
ASSERT_GT(gko::CudaExecutor::get_num_devices(), 0);
auto device_id = comm.node_local_rank() % gko::CudaExecutor::get_num_devices();
auto device_id =
comm.node_local_rank() % gko::CudaExecutor::get_num_devices();
exec = gko::CudaExecutor::create(device_id, ref);
}

Expand All @@ -125,7 +126,8 @@ void init_executor(std::shared_ptr<gko::ReferenceExecutor> ref,
gko::mpi::communicator comm)
{
ASSERT_GT(gko::HipExecutor::get_num_devices(), 0);
auto device_id = comm.node_local_rank() % gko::HipExecutor::get_num_devices();
auto device_id =
comm.node_local_rank() % gko::HipExecutor::get_num_devices();
exec = gko::HipExecutor::create(device_id, ref);
}

Expand All @@ -135,10 +137,12 @@ void init_executor(std::shared_ptr<gko::ReferenceExecutor> ref,
gko::mpi::communicator comm)
{
if (gko::DpcppExecutor::get_num_devices("gpu") > 0) {
auto device_id = comm.node_local_rank() % gko::DpcppExecutor::get_num_devices("gpu");
auto device_id =
comm.node_local_rank() % gko::DpcppExecutor::get_num_devices("gpu");
exec = gko::DpcppExecutor::create(device_id, ref);
} else if (gko::DpcppExecutor::get_num_devices("cpu") > 0) {
auto device_id = comm.node_local_rank() % gko::DpcppExecutor::get_num_devices("cpu");
auto device_id =
comm.node_local_rank() % gko::DpcppExecutor::get_num_devices("cpu");
exec = gko::DpcppExecutor::create(device_id, ref);
} else {
FAIL() << "No suitable DPC++ devices";
Expand Down

0 comments on commit 9abcb7f

Please sign in to comment.