Skip to content

Commit 194a303

Browse files
committed
Reveret to a clean state
1 parent 331158e commit 194a303

File tree

26 files changed

+1013
-3751
lines changed

26 files changed

+1013
-3751
lines changed

include/graphblas/algorithms/conjugate_gradient.hpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define _H_GRB_ALGORITHMS_CONJUGATE_GRADIENT
2828

2929
#include <cstdio>
30-
#include <cmath>
30+
#include <complex>
3131

3232
#include <graphblas.hpp>
3333
#include <graphblas/utils/iscomplex.hpp>
@@ -144,8 +144,7 @@ namespace grb {
144144
* performance semantics, with the exception of getters such as #grb::nnz, are
145145
* specific to the backend selected during compilation.
146146
*/
147-
template<
148-
Descriptor descr = descriptors::no_operation,
147+
template< Descriptor descr = descriptors::no_operation,
149148
typename IOType,
150149
typename ResidualType,
151150
typename NonzeroType,
@@ -155,20 +154,19 @@ namespace grb {
155154
grb::identities::zero, grb::identities::one
156155
>,
157156
class Minus = operators::subtract< IOType >,
158-
class Divide = operators::divide< IOType >,
159-
typename RSI, typename NZI, Backend backend
157+
class Divide = operators::divide< IOType >
160158
>
161159
grb::RC conjugate_gradient(
162-
grb::Vector< IOType, backend > &x,
163-
const grb::Matrix< NonzeroType, backend, RSI, RSI, NZI > &A,
164-
const grb::Vector< InputType, backend > &b,
160+
grb::Vector< IOType > &x,
161+
const grb::Matrix< NonzeroType > &A,
162+
const grb::Vector< InputType > &b,
165163
const size_t max_iterations,
166164
ResidualType tol,
167165
size_t &iterations,
168166
ResidualType &residual,
169-
grb::Vector< IOType, backend > &r,
170-
grb::Vector< IOType, backend > &u,
171-
grb::Vector< IOType, backend > &temp,
167+
grb::Vector< IOType > &r,
168+
grb::Vector< IOType > &u,
169+
grb::Vector< IOType > &temp,
172170
const Ring &ring = Ring(),
173171
const Minus &minus = Minus(),
174172
const Divide &divide = Divide()
@@ -326,7 +324,7 @@ namespace grb {
326324
assert( ret == SUCCESS );
327325

328326
if( ret == SUCCESS ) {
329-
tol *= std::sqrt( grb::utils::is_complex< IOType >::modulus( bnorm ) );
327+
tol *= sqrt( grb::utils::is_complex< IOType >::modulus( bnorm ) );
330328
}
331329

332330
size_t iter = 0;
@@ -419,7 +417,7 @@ namespace grb {
419417

420418
// return correct error code
421419
if( ret == SUCCESS ) {
422-
if( std::sqrt( residual ) >= tol ) {
420+
if( sqrt( residual ) >= tol ) {
423421
// did not converge within iterations
424422
return FAILED;
425423
}

include/graphblas/backends.hpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
#ifndef _H_GRB_BACKENDS
3030
#define _H_GRB_BACKENDS
3131

32-
#include <string>
33-
#include <iostream>
34-
3532

3633
namespace grb {
3734

@@ -221,42 +218,6 @@ namespace grb {
221218

222219
};
223220

224-
/**
225-
* Converts a backend identifier to a human-readable string.
226-
*
227-
* @param[in] backend The backend whose string to return.
228-
*
229-
* @return The name of the given \a backend as a C++ string.
230-
*/
231-
static inline std::string toString( const enum grb::Backend backend ) {
232-
switch( backend ) {
233-
case grb::Backend::reference: return "reference";
234-
case grb::Backend::reference_omp: return "reference_omp";
235-
case grb::Backend::hyperdags: return "hyperdags";
236-
case grb::Backend::nonblocking: return "nonblocking";
237-
case grb::Backend::shmem1D: return "shmem1D";
238-
case grb::Backend::NUMA1D: return "NUMA1D";
239-
case grb::Backend::GENERIC_BSP: return "GENERIC_BSP";
240-
case grb::Backend::BSP1D: return "BSP1D";
241-
case grb::Backend::doublyBSP1D: return "doublyBSP1D";
242-
case grb::Backend::BSP2D: return "BSP2D";
243-
case grb::Backend::autoBSP: return "autoBSP";
244-
case grb::Backend::optBSP: return "optBSP";
245-
case grb::Backend::hybrid: return "hybrid";
246-
case grb::Backend::hybridSmall: return "hybridSmall";
247-
case grb::Backend::hybridMid: return "hybridMid";
248-
case grb::Backend::hybridLarge: return "hybridLarge";
249-
case grb::Backend::minFootprint: return "minFootprint";
250-
case grb::Backend::banshee: return "banshee";
251-
case grb::Backend::banshee_ssr: return "banshee_ssr";
252-
default:
253-
const int backend_id = static_cast< int >( backend );
254-
std::cerr << "Warning, std::string( const grb::Backend ): unknown backend "
255-
<< backend_id << " encountered, please submit a bug report.\n";
256-
return "unknown_backend(id=" + std::to_string( backend_id ) + ")";
257-
}
258-
}
259-
260221
} // namespace grb
261222

262223
#endif

0 commit comments

Comments
 (0)