Skip to content

Commit b345031

Browse files
committed
GPU: Array add fill method
1 parent 5a7fba3 commit b345031

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

GPU/Common/GPUCommonArray.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ struct array {
2929
GPUd() const T& operator[](size_t i) const { return m_internal_V__[i]; };
3030
GPUd() T* data() { return m_internal_V__; };
3131
GPUd() const T* data() const { return m_internal_V__; };
32+
GPUd() void fill(const T& t)
33+
{
34+
for (size_t i{0}; i < N; ++i) {
35+
m_internal_V__[i] = t;
36+
}
37+
}
3238
T m_internal_V__[N];
3339
};
3440
template <class T, class... E>

0 commit comments

Comments
 (0)