Skip to content

Commit

Permalink
13
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Sep 23, 2024
1 parent 3f99c5c commit fe95eee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit/cuda/solver/test_cuda_lu_decomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ void testCudaRandomMatrix(size_t n_grids)
gpu_lud.Decompose<GPUSparseMatrixPolicy>(gpu_A, gpu_LU.first, gpu_LU.second);
gpu_LU.first.CopyToHost();
gpu_LU.second.CopyToHost();
// check_results<typename GPUSparseMatrixPolicy::value_type, GPUSparseMatrixPolicy>(
// gpu_A, gpu_LU.first, gpu_LU.second, [&](const double a, const double b) -> void { EXPECT_LT(std::abs((a-b)/b), 1.0e-10); });
check_results<typename GPUSparseMatrixPolicy::value_type, GPUSparseMatrixPolicy>(
gpu_A, gpu_LU.first, gpu_LU.second, [&](const double a, const double b) -> void { EXPECT_LT(std::abs((a-b)/b), 1.0e-10); });

micm::LuDecomposition cpu_lud = micm::LuDecomposition::Create<CPUSparseMatrixPolicy>(cpu_A);
auto cpu_LU = micm::LuDecomposition::GetLUMatrices<CPUSparseMatrixPolicy>(cpu_A, 1.0e-30);
Expand All @@ -66,13 +66,13 @@ void testCudaRandomMatrix(size_t n_grids)
{
auto gpu_L = gpu_L_vector[i];
auto cpu_L = cpu_L_vector[i];
EXPECT_LT(std::abs((gpu_L - cpu_L) / cpu_L), 1.0e-10);
EXPECT_LT(std::abs((gpu_L - cpu_L) / cpu_L), 1.0e-13);
};
for (int j = 0; j < U_size; ++j)
{
auto gpu_U = gpu_U_vector[j];
auto cpu_U = cpu_U_vector[j];
EXPECT_LT(std::abs((gpu_U - cpu_U) / cpu_U), 1.0e-10);
EXPECT_LT(std::abs((gpu_U - cpu_U) / cpu_U), 1.0e-13);
};
}

Expand Down

0 comments on commit fe95eee

Please sign in to comment.