Skip to content

Commit

Permalink
sparse: Deprecate .hpp headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ahendriksen committed Jul 18, 2022
1 parent afd9573 commit 99df1ef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 131 deletions.
32 changes: 4 additions & 28 deletions cpp/include/raft/sparse/convert/coo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,10 @@
* Please use the cuh version instead.
*/

#ifndef __COO_H
#define __COO_H

#pragma once

#include <raft/sparse/convert/detail/coo.cuh>

namespace raft {
namespace sparse {
namespace convert {

/**
* @brief Convert a CSR row_ind array to a COO rows array
* @param row_ind: Input CSR row_ind array
* @param m: size of row_ind array
* @param coo_rows: Output COO row array
* @param nnz: size of output COO row array
* @param stream: cuda stream to use
*/
template <typename value_idx = int>
void csr_to_coo(
const value_idx* row_ind, value_idx m, value_idx* coo_rows, value_idx nnz, cudaStream_t stream)
{
detail::csr_to_coo<value_idx, 32>(row_ind, m, coo_rows, nnz, stream);
}

}; // end NAMESPACE convert
}; // end NAMESPACE sparse
}; // end NAMESPACE raft
#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the cuh version instead.")

#endif
#include "coo.cuh"
61 changes: 7 additions & 54 deletions cpp/include/raft/sparse/convert/csr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* This file is deprecated and will be removed in release 22.06.
* Please use the cuh version instead.
*/

#ifndef __CSR_H
#define __CSR_H

#pragma once

#include <raft/sparse/convert/detail/csr.cuh>
#include <raft/sparse/csr.hpp>

namespace raft {
namespace sparse {
namespace convert {

template <typename value_t>
void coo_to_csr(const raft::handle_t& handle,
const int* srcRows,
const int* srcCols,
const value_t* srcVals,
int nnz,
int m,
int* dst_offsets,
int* dstCols,
value_t* dstVals)
{
detail::coo_to_csr(handle, srcRows, srcCols, srcVals, nnz, m, dst_offsets, dstCols, dstVals);
}

/**
* @brief Generate the row indices array for a sorted COO matrix
*
* @param rows: COO rows array
* @param nnz: size of COO rows array
* @param row_ind: output row indices array
* @param m: number of rows in dense matrix
* @param stream: cuda stream to use
* DISCLAIMER: this file is deprecated: use csr.cuh instead
*/
template <typename T>
void sorted_coo_to_csr(const T* rows, int nnz, T* row_ind, int m, cudaStream_t stream)
{
detail::sorted_coo_to_csr(rows, nnz, row_ind, m, stream);
}

/**
* @brief Generate the row indices array for a sorted COO matrix
*
* @param coo: Input COO matrix
* @param row_ind: output row indices array
* @param stream: cuda stream to use
*/
template <typename T>
void sorted_coo_to_csr(COO<T>* coo, int* row_ind, cudaStream_t stream)
{
detail::sorted_coo_to_csr(coo->rows(), coo->nnz, row_ind, coo->n_rows, stream);
}
#pragma once

}; // end NAMESPACE convert
}; // end NAMESPACE sparse
}; // end NAMESPACE raft
#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the cuh version instead.")

#endif
#include "csr.cuh"
53 changes: 4 additions & 49 deletions cpp/include/raft/sparse/convert/dense.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,10 @@
* Please use the cuh version instead.
*/

#ifndef __DENSE_H
#define __DENSE_H

#pragma once

#include <raft/sparse/convert/detail/dense.cuh>

namespace raft {
namespace sparse {
namespace convert {

/**
* Convert CSR arrays to a dense matrix in either row-
* or column-major format. A custom kernel is used when
* row-major output is desired since cusparse does not
* output row-major.
* @tparam value_idx : data type of the CSR index arrays
* @tparam value_t : data type of the CSR value array
* @param[in] handle : cusparse handle for conversion
* @param[in] nrows : number of rows in CSR
* @param[in] ncols : number of columns in CSR
* @param[in] nnz : number of nonzeros in CSR
* @param[in] csr_indptr : CSR row index pointer array
* @param[in] csr_indices : CSR column indices array
* @param[in] csr_data : CSR data array
* @param[in] lda : Leading dimension (used for col-major only)
* @param[out] out : Dense output array of size nrows * ncols
* @param[in] stream : Cuda stream for ordering events
* @param[in] row_major : Is row-major output desired?
*/
template <typename value_idx, typename value_t>
void csr_to_dense(cusparseHandle_t handle,
value_idx nrows,
value_idx ncols,
value_idx nnz,
const value_idx* csr_indptr,
const value_idx* csr_indices,
const value_t* csr_data,
value_idx lda,
value_t* out,
cudaStream_t stream,
bool row_major = true)
{
detail::csr_to_dense<value_idx, value_t>(
handle, nrows, ncols, nnz, csr_indptr, csr_indices, csr_data, lda, out, stream, row_major);
}

}; // end NAMESPACE convert
}; // end NAMESPACE sparse
}; // end NAMESPACE raft
#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the cuh version instead.")

#endif
#include "dense.cuh"

0 comments on commit 99df1ef

Please sign in to comment.