Navigation Menu

Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Commit

Permalink
Further tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jul 29, 2009
1 parent 9dfa212 commit a627a1e
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 21 deletions.
11 changes: 11 additions & 0 deletions CMake/FindMETIS.cmake
Expand Up @@ -13,21 +13,32 @@

# derived from code by Christophe Prud'homme.

SET(METIS_DIR "/usr" CACHE PATH "Root directory for the Metis install")

FIND_PATH(METIS_INCLUDE_DIR metis.h
"${METIS_DIR}/include"
/usr/local/include
/usr/include
/usr/include/metis
)

FIND_LIBRARY(METIS_LIBRARY metis
${METIS_DIR}/lib/
${METIS_DIR}/build/Linux-i686/
${METIS_DIR}/build/Linux-x86_64/
/usr/local/lib
/usr/lib
)

MESSAGE("${METIS_INCLUDE_DIR} yo")
MESSAGE("${METIS_LIBRARY} yo")

IF(METIS_INCLUDE_DIR AND METIS_LIBRARY)
SET( METIS_FOUND "YES" )
ELSE()
IF(METIS_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "METIS not found")
ENDIF()
ENDIF()

MARK_AS_ADVANCED(METIS_INCLUDE_DIR METIS_LIBRARY)
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -13,4 +13,4 @@ find_package(METIS REQUIRED)
include_directories("${CMAKE_SOURCE_DIR}/include")
include_directories("${CMAKE_SOURCE_DIR}/src/spmv/kernels")

subdirs( src)
subdirs(src)
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
@@ -1,7 +1,7 @@
set(BUILD_SHARED_LIBS ON)

include_directories(${METIS_INCLUDE_DIR})
message("${METIS_INCLUDE_DIR} bitches")
message("${METIS_LIBRARY} bitches")

cuda_add_library(iterativecuda
host_instantiation.cpp
Expand Down
60 changes: 45 additions & 15 deletions src/gpu-sparse-matrix.hpp
Expand Up @@ -49,19 +49,7 @@ namespace iterative_cuda
template <typename ValueType, typename IndexType>
struct gpu_sparse_pkt_matrix_pimpl
{
// these are GPU pointers
IndexType *permute_old_to_new;
IndexType *permute_new_to_old;

packed_index_type *index_array;
ValueType *data_array;

IndexType *pos_start;
IndexType *pos_end;

IndexType *coo_i;
IndexType *coo_j;
ValueType *coo_v;
pkt_matrix<IndexType, ValueType> matrix;
};


Expand Down Expand Up @@ -90,11 +78,53 @@ namespace iterative_cuda
std::vector<index_type> partition;
partition_csr(csr_mat, block_count, partition, /*Kway*/ true);

pkt_matrix<index_type, value_type> pkt =
csr_to_pkt(csr_mat, partition.data());
pimpl->matrix = csr_to_pkt(csr_mat, partition.data());
}




template <typename VT, typename IT>
gpu_sparse_pkt_matrix<VT, IT>::~gpu_sparse_pkt_matrix()
{
delete_pkt_matrix(pimpl->matrix);
}




template <typename VT, typename IT>
gpu_sparse_pkt_matrix<VT, IT>::index_type
gpu_sparse_pkt_matrix<VT, IT>::row_count() const
{
return pimpl->matrix.num_rows;
}




template <typename VT, typename IT>
gpu_sparse_pkt_matrix<VT, IT>::index_type
gpu_sparse_pkt_matrix<VT, IT>::column_count() const
{
return pimpl->matrix.num_cols;
}

template <typename VT, typename IT>
void gpu_sparse_pkt_matrix<VT, IT>::permute(
vector_type const &dest,
vector_type const &src) const
{
}




template <typename VT, typename IT>
void gpu_sparse_pkt_matrix<VT, IT>::unpermute(
vector_type const &dest,
vector_type const &src) const
{
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/host_instantiation.cpp
Expand Up @@ -37,7 +37,3 @@ using namespace iterative_cuda;



template class gpu_vector<float>;
template class gpu_vector<double>;
template class gpu_sparse_pkt_matrix<float>;
template class gpu_sparse_pkt_matrix<double>;

0 comments on commit a627a1e

Please sign in to comment.