From fc035becf771ffc264eabd9d9390dafee7513d12 Mon Sep 17 00:00:00 2001 From: Yichao Yu <yyc1992@gmail.com> Date: Thu, 19 Jun 2014 06:44:00 +0800 Subject: [PATCH] pyopencl_buf.to_arg --- src/c_wrapper/utils.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/c_wrapper/utils.h b/src/c_wrapper/utils.h index 2cc22b39..bd39f4df 100644 --- a/src/c_wrapper/utils.h +++ b/src/c_wrapper/utils.h @@ -398,6 +398,18 @@ public: this->reset((T*)realloc((void*)this->release(), (len + 1) * sizeof(T))); } + template<ArgType AT=ArgType::Length> + PYOPENCL_INLINE ArgBuffer<T, AT> + to_arg() + { + return ArgBuffer<T, AT>(this->get(), m_len); + } + template<ArgType AT=ArgType::Length> + PYOPENCL_INLINE ArgBuffer<const T, AT> + to_arg() const + { + return ArgBuffer<const T, AT>(this->get(), m_len); + } }; template<typename Buff> -- GitLab