From 69f2911e04ffb1b19eef1fafb8c040af271f656e Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 18:09:46 -0800 Subject: creating branch for adding support for CUDA 3.x and Fermi [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829] --- .../3rdParty/ParMetis-3.1/ParMETISLib/csrmatch.c | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/ParMETISLib/csrmatch.c (limited to 'benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/ParMETISLib/csrmatch.c') diff --git a/benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/ParMETISLib/csrmatch.c b/benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/ParMETISLib/csrmatch.c new file mode 100644 index 0000000..ace7998 --- /dev/null +++ b/benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/ParMETISLib/csrmatch.c @@ -0,0 +1,88 @@ +/* + * Copyright 1997, Regents of the University of Minnesota + * + * csrmatch.c + * + * This file contains the code that computes matchings + * + * Started 7/23/97 + * George + * + * $Id: csrmatch.c,v 1.2 2003/07/21 17:18:48 karypis Exp $ + * + */ + +#include + + + + +/************************************************************************* +* This function finds a matching using the HEM heuristic +**************************************************************************/ +void CSR_Match_SHEM(MatrixType *matrix, idxtype *match, idxtype *mlist, + idxtype *skip, int ncon) +{ + int h, i, ii, j; + int nrows, edge, maxidx, count; + float maxwgt; + idxtype *rowptr, *colind; + float *transfer; + KVType *links; + + nrows = matrix->nrows; + rowptr = matrix->rowptr; + colind = matrix->colind; + transfer = matrix->transfer; + + idxset(nrows, UNMATCHED, match); + + links = (KVType *)GKmalloc(sizeof(KVType)*nrows, "links"); + for (i=0; i