Skip to content

Commit

Permalink
fix a few header and documentation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckHastings committed Nov 15, 2024
1 parent 964d63d commit e1e6cba
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 5 deletions.
46 changes: 45 additions & 1 deletion cpp/include/cugraph/device_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#pragma once

#include "cugraph_c/types.h"
#include <cugraph_c/types.h>

#include <cugraph/utilities/cugraph_data_type_id.hpp>
#include <cugraph/utilities/error.hpp>
Expand Down Expand Up @@ -71,33 +71,77 @@ class device_vector_t {
data_ = vector.release();
}

/**
* Return a pointer of the specified type to the beginning of the vector
*
* @tparam T type for the array vector
*
* @return pointer to the beginning of the vector
*/
template <typename T>
T* begin()
{
return reinterpret_cast<T*>(data_.data());
}

/**
* Return a const pointer of the specified type to the beginning of the vector
*
* @tparam T type for the array vector
*
* @return const pointer to the beginning of the vector
*/
template <typename T>
T const* begin() const
{
return reinterpret_cast<T const*>(data_.data());
}

/**
* Return a pointer of the specified type to the end of the vector
*
* @tparam T type for the array vector
*
* @return pointer to the end of the vector
*/
template <typename T>
T* end()
{
return reinterpret_cast<T*>(data_.data()) + size_;
}

/**
* Return a const pointer of the specified type to the end of the vector
*
* @tparam T type for the array vector
*
* @return const pointer to the end of the vector
*/
template <typename T>
T const* end() const
{
return reinterpret_cast<T const*>(data_.data()) + size_;
}

/**
* Return the type of the vector
*
* @return type id of the type stored in the vector
*/
cugraph_data_type_id_t type() const { return type_; }

/**
* Return the number of elements in the vector
*
* @return number of elements in the vector
*/
size_t size() const { return size_; }

/**
* Release the vector and shrink the memory used
*
* @param stream_view CUDA stream
*/
void clear(rmm::cuda_stream_view stream_view)
{
data_.resize(0, stream_view);
Expand Down
10 changes: 6 additions & 4 deletions cpp/include/cugraph/edge_properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#pragma once

#include "cugraph/device_vector.hpp"
#include "cugraph_c/types.h"
#include <cugraph_c/types.h>

#include <cugraph/device_vector.hpp>
#include <cugraph/edge_property.hpp>
#include <cugraph/utilities/cugraph_data_type_id.hpp>
#include <cugraph/utilities/error.hpp>
Expand Down Expand Up @@ -139,7 +139,7 @@ class edge_properties_t {
* @tparam value_t Typename for the property
* @param idx Index of the property
*
* @returns a read-only view for accessing the property
* @return a read-only view for accessing the property
*/
template <typename edge_t, typename value_t>
edge_property_view_t<edge_t, value_t const*> view(size_t idx) const;
Expand All @@ -154,13 +154,15 @@ class edge_properties_t {
* @tparam value_t Typename for the property
* @param idx Index of the property
*
* @returns a read-write view for accessing the property
* @return a read-write view for accessing the property
*/
template <typename edge_t, typename value_t>
edge_property_view_t<edge_t, value_t*> mutable_view(size_t idx);

/**
* Return list of defined properties
*
* @return vector of defined property indexes
*/
std::vector<size_t> defined() const;

Expand Down

0 comments on commit e1e6cba

Please sign in to comment.