From b34503159d134b54242a48675dab5a26a939d328 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Wed, 2 Apr 2025 18:44:14 +0200 Subject: [PATCH] GPU: Array add fill method --- GPU/Common/GPUCommonArray.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GPU/Common/GPUCommonArray.h b/GPU/Common/GPUCommonArray.h index 853d864dc2d4d..c9babbf5548b4 100644 --- a/GPU/Common/GPUCommonArray.h +++ b/GPU/Common/GPUCommonArray.h @@ -29,6 +29,12 @@ struct array { GPUd() const T& operator[](size_t i) const { return m_internal_V__[i]; }; GPUd() T* data() { return m_internal_V__; }; GPUd() const T* data() const { return m_internal_V__; }; + GPUd() void fill(const T& t) + { + for (size_t i{0}; i < N; ++i) { + m_internal_V__[i] = t; + } + } T m_internal_V__[N]; }; template