Skip to content

Commit

Permalink
Fix failing Windows build (#563)
Browse files Browse the repository at this point in the history
Fix failing Windows build (#553)

* Explicit conversions for fs::path

* Addressed review comment
  • Loading branch information
tfalders authored Jun 13, 2023
1 parent bd8f5ff commit a220f13
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 59 deletions.
20 changes: 10 additions & 10 deletions clients/include/testing_csrrf_analysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,27 +160,27 @@ void csrrf_analysis_initData(rocblas_handle handle,

// read-in A
file = testcase / "ptrA";
read_matrix(file, 1, n + 1, hptrA.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrA.data(), 1);
file = testcase / "indA";
read_matrix(file, 1, nnzA, hindA.data(), 1);
read_matrix(file.string(), 1, nnzA, hindA.data(), 1);
file = testcase / "valA";
read_matrix(file, 1, nnzA, hvalA.data(), 1);
read_matrix(file.string(), 1, nnzA, hvalA.data(), 1);

// read-in T
file = testcase / "ptrT";
read_matrix(file, 1, n + 1, hptrT.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrT.data(), 1);
file = testcase / "indT";
read_matrix(file, 1, nnzT, hindT.data(), 1);
read_matrix(file.string(), 1, nnzT, hindT.data(), 1);
file = testcase / "valT";
read_matrix(file, 1, nnzT, hvalT.data(), 1);
read_matrix(file.string(), 1, nnzT, hvalT.data(), 1);

// read-in P
file = testcase / "P";
read_matrix(file, 1, n, hpivP.data(), 1);
read_matrix(file.string(), 1, n, hpivP.data(), 1);

// read-in Q
file = testcase / "Q";
read_matrix(file, 1, n, hpivQ.data(), 1);
read_matrix(file.string(), 1, n, hpivQ.data(), 1);
}

if(GPU)
Expand Down Expand Up @@ -403,9 +403,9 @@ void testing_csrrf_analysis(Arguments& argus)
fs::path testcase;
if(n > 0)
{
testcase = get_sparse_data_dir() / fmt::format("mat_{}_{}", n, nnzM);
testcase = get_sparse_data_dir() / fs::path(fmt::format("mat_{}_{}", n, nnzM));
fs::path file = testcase / "ptrT";
read_last(file, &nnzT);
read_last(file.string(), &nnzT);
}

// memory size query if necessary
Expand Down
22 changes: 11 additions & 11 deletions clients/include/testing_csrrf_refactlu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,31 +145,31 @@ void csrrf_refactlu_initData(rocblas_handle handle,
{
if(CPU)
{
std::string file;
fs::path file;

// read-in A
file = testcase / "ptrA";
read_matrix(file, 1, n + 1, hptrA.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrA.data(), 1);
file = testcase / "indA";
read_matrix(file, 1, nnzA, hindA.data(), 1);
read_matrix(file.string(), 1, nnzA, hindA.data(), 1);
file = testcase / "valA";
read_matrix(file, 1, nnzA, hvalA.data(), 1);
read_matrix(file.string(), 1, nnzA, hvalA.data(), 1);

// read-in T
file = testcase / "ptrT";
read_matrix(file, 1, n + 1, hptrT.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrT.data(), 1);
file = testcase / "indT";
read_matrix(file, 1, nnzT, hindT.data(), 1);
read_matrix(file.string(), 1, nnzT, hindT.data(), 1);
file = testcase / "valT";
read_matrix(file, 1, nnzT, hvalT.data(), 1);
read_matrix(file.string(), 1, nnzT, hvalT.data(), 1);

// read-in P
file = testcase / "P";
read_matrix(file, 1, n, hpivP.data(), 1);
read_matrix(file.string(), 1, n, hpivP.data(), 1);

// read-in Q
file = testcase / "Q";
read_matrix(file, 1, n, hpivQ.data(), 1);
read_matrix(file.string(), 1, n, hpivQ.data(), 1);
}

if(GPU)
Expand Down Expand Up @@ -380,9 +380,9 @@ void testing_csrrf_refactlu(Arguments& argus)
fs::path testcase;
if(n > 0)
{
testcase = get_sparse_data_dir() / fmt::format("mat_{}_{}", n, nnzA);
testcase = get_sparse_data_dir() / fs::path(fmt::format("mat_{}_{}", n, nnzA));
fs::path file = testcase / "ptrT";
read_last(file, &nnzT);
read_last(file.string(), &nnzT);
}

// memory size query if necessary
Expand Down
24 changes: 12 additions & 12 deletions clients/include/testing_csrrf_solve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,34 +131,34 @@ void csrrf_solve_initData(rocblas_handle handle,
{
if(CPU)
{
std::string file;
fs::path file;

// read-in T
file = testcase / "ptrT";
read_matrix(file, 1, n + 1, hptrT.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrT.data(), 1);
file = testcase / "indT";
read_matrix(file, 1, nnzT, hindT.data(), 1);
read_matrix(file.string(), 1, nnzT, hindT.data(), 1);
file = testcase / "valT";
read_matrix(file, 1, nnzT, hvalT.data(), 1);
read_matrix(file.string(), 1, nnzT, hvalT.data(), 1);

// read-in P
file = testcase / "P";
read_matrix(file, 1, n, hpivP.data(), 1);
read_matrix(file.string(), 1, n, hpivP.data(), 1);

// read-in Q
file = testcase / "Q";
read_matrix(file, 1, n, hpivQ.data(), 1);
read_matrix(file.string(), 1, n, hpivQ.data(), 1);

// read-in B
file = testcase / fmt::format("B_{}", nrhs);
read_matrix(file, n, nrhs, hB.data(), ldb);
file = testcase / fs::path(fmt::format("B_{}", nrhs));
read_matrix(file.string(), n, nrhs, hB.data(), ldb);

// get results (matrix X) if validation is required
if(test)
{
// read-in X
file = testcase / fmt::format("X_{}", nrhs);
read_matrix(file, n, nrhs, hX.data(), ldb);
file = testcase / fs::path(fmt::format("X_{}", nrhs));
read_matrix(file.string(), n, nrhs, hX.data(), ldb);
}
}

Expand Down Expand Up @@ -363,9 +363,9 @@ void testing_csrrf_solve(Arguments& argus)
fs::path testcase;
if(n > 0)
{
testcase = get_sparse_data_dir() / fmt::format("mat_{}_{}", n, nnzA);
testcase = get_sparse_data_dir() / fs::path(fmt::format("mat_{}_{}", n, nnzA));
fs::path file = testcase / "ptrT";
read_last(file, &nnzT);
read_last(file.string(), &nnzT);
}

// determine existing right-hand-side
Expand Down
26 changes: 13 additions & 13 deletions clients/include/testing_csrrf_splitlu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ void csrrf_splitlu_initData(rocblas_handle handle,
{
if(CPU)
{
std::string file;
fs::path file;

// read-in T
file = testcase / "ptrT";
read_matrix(file, 1, n + 1, hptrT.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrT.data(), 1);
file = testcase / "indT";
read_matrix(file, 1, nnzT, hindT.data(), 1);
read_matrix(file.string(), 1, nnzT, hindT.data(), 1);
file = testcase / "valT";
read_matrix(file, 1, nnzT, hvalT.data(), 1);
read_matrix(file.string(), 1, nnzT, hvalT.data(), 1);

// get results (matrices L and U) if validation is required
if(test)
Expand All @@ -157,21 +157,21 @@ void csrrf_splitlu_initData(rocblas_handle handle,

// read-in L
file = testcase / "ptrL";
read_matrix(file, 1, n + 1, hptrL.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrL.data(), 1);
nnzL = hptrL[0][n];
file = testcase / "indL";
read_matrix(file, 1, nnzL, hindL.data(), 1);
read_matrix(file.string(), 1, nnzL, hindL.data(), 1);
file = testcase / "valL";
read_matrix(file, 1, nnzL, hvalL.data(), 1);
read_matrix(file.string(), 1, nnzL, hvalL.data(), 1);

// read-in U
file = testcase / "ptrU";
read_matrix(file, 1, n + 1, hptrU.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrU.data(), 1);
nnzU = hptrU[0][n];
file = testcase / "indU";
read_matrix(file, 1, nnzU, hindU.data(), 1);
read_matrix(file.string(), 1, nnzU, hindU.data(), 1);
file = testcase / "valU";
read_matrix(file, 1, nnzU, hvalU.data(), 1);
read_matrix(file.string(), 1, nnzU, hvalU.data(), 1);
}
}

Expand Down Expand Up @@ -427,11 +427,11 @@ void testing_csrrf_splitlu(Arguments& argus)
rocblas_int nnzL = n;
if(!mat_zero && n > 0)
{
testcase = get_sparse_data_dir() / fmt::format("mat_{}_{}", n, nnzA);
testcase = get_sparse_data_dir() / fs::path(fmt::format("mat_{}_{}", n, nnzA));
fs::path file = testcase / "ptrL";
read_last(file, &nnzL);
read_last(file.string(), &nnzL);
file = testcase / "ptrU";
read_last(file, &nnzU);
read_last(file.string(), &nnzU);
}
nnzT = nnzL + nnzU - n;

Expand Down
26 changes: 13 additions & 13 deletions clients/include/testing_csrrf_sumlu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,34 +142,34 @@ void csrrf_sumlu_initData(rocblas_handle handle,
{
if(CPU)
{
std::string file;
fs::path file;

// read-in L
file = testcase / "ptrL";
read_matrix(file, 1, n + 1, hptrL.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrL.data(), 1);
file = testcase / "indL";
read_matrix(file, 1, nnzL, hindL.data(), 1);
read_matrix(file.string(), 1, nnzL, hindL.data(), 1);
file = testcase / "valL";
read_matrix(file, 1, nnzL, hvalL.data(), 1);
read_matrix(file.string(), 1, nnzL, hvalL.data(), 1);

// read-in U
file = testcase / "ptrU";
read_matrix(file, 1, n + 1, hptrU.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrU.data(), 1);
file = testcase / "indU";
read_matrix(file, 1, nnzU, hindU.data(), 1);
read_matrix(file.string(), 1, nnzU, hindU.data(), 1);
file = testcase / "valU";
read_matrix(file, 1, nnzU, hvalU.data(), 1);
read_matrix(file.string(), 1, nnzU, hvalU.data(), 1);

// get results (matrix T) if validation is required
if(test)
{
rocblas_int nnzT = nnzL + nnzU - n;
file = testcase / "ptrT";
read_matrix(file, 1, n + 1, hptrT.data(), 1);
read_matrix(file.string(), 1, n + 1, hptrT.data(), 1);
file = testcase / "indT";
read_matrix(file, 1, nnzT, hindT.data(), 1);
read_matrix(file.string(), 1, nnzT, hindT.data(), 1);
file = testcase / "valT";
read_matrix(file, 1, nnzT, hvalT.data(), 1);
read_matrix(file.string(), 1, nnzT, hvalT.data(), 1);
}
}

Expand Down Expand Up @@ -407,11 +407,11 @@ void testing_csrrf_sumlu(Arguments& argus)
fs::path testcase;
if(!mat_zero && n > 0)
{
testcase = get_sparse_data_dir() / fmt::format("mat_{}_{}", n, nnzA);
testcase = get_sparse_data_dir() / fs::path(fmt::format("mat_{}_{}", n, nnzA));
fs::path file = testcase / "ptrL";
read_last(file, &nnzL);
read_last(file.string(), &nnzL);
file = testcase / "ptrU";
read_last(file, &nnzU);
read_last(file.string(), &nnzU);
}
rocblas_int nnzT = nnzL + nnzU - n;

Expand Down

0 comments on commit a220f13

Please sign in to comment.