Skip to content

Commit c6c5f54

Browse files
committed
shaked debugging
1 parent 9c471ea commit c6c5f54

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

resolve/hykkt/cholesky/CholeskySolverCpu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace ReSolve
7777
(size_t) A->getNumColumns(),
7878
(size_t) A->getNnz(),
7979
1,
80-
1,
80+
0,
8181
1,
8282
CHOLMOD_REAL,
8383
&Common_);

resolve/hykkt/cholesky/CholeskySolverHip.cpp

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,23 @@ namespace ReSolve
8888
static_cast<real_type*>(L_chol_tr->x),
8989
memory::HOST,
9090
memory::DEVICE);
91-
// L_->syncData(memory::HOST);
92-
// L_->print(std::cout);
91+
L_->syncData(memory::HOST);
92+
L_->print(std::cout);
9393
// Store fill-in reducing permutation.
9494
// Within HyKKT, this will be the identity permutation because the Permutation class will permute the matrix.
9595
mem_.allocateArrayOnDevice(&Q_, A_->getNumRows());
9696
mem_.copyArrayHostToDevice(Q_, static_cast<index_type*>(factorization_->Perm), A_->getNumRows());
97-
97+
// print Q
98+
// std::cout << "Q_: ";
99+
for (size_t i = 0; i < A_->getNumRows(); ++i)
100+
{
101+
std::cout << static_cast<index_type*>(factorization_->Perm)[i] << " ";
102+
}
103+
A_->print(std::cout);
98104
// Store analysis in rfinfo_
99105
rocblas_status status = rocsolver_dcsrrf_analysis(handle_,
100106
A_->getNumRows(),
101-
0,
107+
1,
102108
A_->getNnz(),
103109
A_->getRowData(memory::DEVICE),
104110
A_->getColData(memory::DEVICE),
@@ -107,11 +113,12 @@ namespace ReSolve
107113
L_->getRowData(memory::DEVICE),
108114
L_->getColData(memory::DEVICE),
109115
L_->getValues(memory::DEVICE),
110-
nullptr,
111116
Q_,
112-
nullptr,
117+
Q_,
118+
L_->getValues(memory::DEVICE),
113119
A_->getNumRows(),
114120
rfinfo_);
121+
std::cout << status << std::endl;
115122
if (status != rocblas_status_success)
116123
{
117124
out::error() << "Analysis step failed with status: " << status << "\n";
@@ -152,14 +159,24 @@ namespace ReSolve
152159
// std::cout << Q_ << "\n";
153160
// std::cout << x->getSize() << "\n";
154161
// std::cout << rfinfo_ << "\n";
162+
// L_->syncData(memory::HOST);
163+
// L_->setUpdated(memory::DEVICE);
164+
// L_->syncData(memory::HOST);
165+
// L_->print();
166+
// x->syncData(memory::HOST);
167+
// for (size_t i = 0; i < x->getSize(); ++i)
168+
// {
169+
// std::cout << "x[" << i << "] = " << x->getData(memory::HOST)[i] << "\n";
170+
// }
171+
155172
rocblas_status status = rocsolver_dcsrrf_solve(handle_,
156173
L_->getNumRows(),
157174
1,
158175
L_->getNnz(),
159176
L_->getRowData(memory::DEVICE),
160177
L_->getColData(memory::DEVICE),
161178
L_->getValues(memory::DEVICE),
162-
nullptr,
179+
Q_,
163180
Q_,
164181
x->getData(memory::DEVICE),
165182
x->getSize(),

tests/unit/hykkt/HykktCholeskyTests.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace ReSolve
5757
{
5858
A->syncData(memory::DEVICE);
5959
}
60-
60+
std::cout << "Matrix A:" << std::endl;
6161
ReSolve::hykkt::CholeskySolver solver(memspace_);
6262
solver.addMatrixInfo(A);
6363
solver.symbolicAnalysis();
@@ -72,6 +72,7 @@ namespace ReSolve
7272

7373
if (memspace_ == memory::DEVICE)
7474
{
75+
x->setDataUpdated(memory::DEVICE);
7576
x->syncData(memory::HOST);
7677
}
7778

0 commit comments

Comments
 (0)