Skip to content

Commit 2c4fc39

Browse files
updates
1 parent 25dac37 commit 2c4fc39

File tree

2 files changed

+52
-10
lines changed

2 files changed

+52
-10
lines changed

raftinc/kernel_pair_t.hpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,14 @@ namespace raft
5656
class kernel_pair_t
5757
{
5858
/** container with ref wrapper **/
59-
template < class CONTAINER > using kernel_pair_t_base =
60-
CONTAINER< std::reference_wrapper< raft::kernel > > >;
61-
/** instantiation of vector as that container type **/
62-
using kernel_pair_t_container = kernel_pair_t_base< std::vector >;
63-
59+
using kernel_pair_t_container =
60+
std::vector< std::reference_wrapper< raft::kernel> >;
6461

6562
public:
6663
/**
6764
* define iterator type publicly
6865
*/
69-
using kernel_iterator_type = typename kernel_pair_t_container::iterator_type;
66+
using kernel_iterator_type = kernel_pair_t_container::iterator;
7067
/**
7168
* endpoint ret type is a std::pair with
7269
* two iterators, one for begin, the second
@@ -119,31 +116,31 @@ class kernel_pair_t
119116
* to end();
120117
* @return endpoint_ret_type
121118
*/
122-
endpoint_ret_type getSrc();
119+
kernel_pair_t::endpoint_ret_type getSrc();
123120
/**
124121
* getSrcSize - returns the size of the source
125122
* container. This is the number of kernels
126123
* within the last map addition.
127124
* @return size_type - number of kernels in source
128125
* container
129126
*/
130-
size_type getSrcSize() noexcept;
127+
kernel_pair_t::size_type getSrcSize() noexcept;
131128
/**
132129
* getDst - return a std::pair object with iterators
133130
* to the dst list of kernels added in the last map
134131
* addition. Again, pair.first maps ot begin(), and
135132
* pair.second maps to end();
136133
* @return endpoint_ret_type
137134
*/
138-
endpoint_ret_type getDst();
135+
kernel_pair_t::endpoint_ret_type getDst();
139136
/**
140137
* getDstSize - returns the size of the destination
141138
* container. This is the number of kernels
142139
* within the last map addition.
143140
* @return size_type - number of kernels in source
144141
* container
145142
*/
146-
size_type getDstSize() noexcept;
143+
kernel_pair_t::size_type getDstSize() noexcept;
147144
/**
148145
* addSrc - add a source kernel to this pair object
149146
* which is retreivable by the getSrc. If this object

src/kernel_pair_t.cpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,48 @@ kernel_pair_t::kernel_pair_t( raft::kernel * const src,
1313
source.emplace_back( *src );
1414
destination.emplace_back( *dst );
1515
}
16+
17+
18+
kernel_pair_t::kernel_pair_t( raft::kernel &src,
19+
raft::kernel &dst ) : kernel_pair_t()
20+
{
21+
source.emplace_back( &src );
22+
destination.emplace_back( dst );
23+
}
24+
25+
kernel_pair_t::endpoint_ret_type
26+
kernel_pair_t::getSrc()
27+
{
28+
return( endpoint_ret_type( source.begin(), source.end() ) );
29+
}
30+
31+
kernel_pair_t::size_type
32+
kernel_pair_t::getSrcSize() noexcept
33+
{
34+
return( source.size() );
35+
}
36+
37+
38+
kernel_pair_t::endpoint_ret_type
39+
kernel_pair_t::getDst()
40+
{
41+
return( endpoint_ret_type( destination.begin(), destination.end() ) );
42+
}
43+
44+
kernel_pair_t::size_type
45+
kernel_pair_t::getDstSize() noexcept
46+
{
47+
return( destination.size() );
48+
}
49+
50+
void
51+
kernel_pair_t::addSrc( raft::kernel &k ) noexcept
52+
{
53+
source.emplace_back( k );
54+
}
55+
56+
void
57+
kernel_pair_t::addDst( raft::kernel &k ) noexcept
58+
{
59+
destination.emplace_back( k );
60+
}

0 commit comments

Comments
 (0)