-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCLWriteBuffer.hpp
More file actions
51 lines (44 loc) · 1.12 KB
/
CLWriteBuffer.hpp
File metadata and controls
51 lines (44 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef TCL_WRITE_BUFFER_HPP
#define TCL_WRITE_BUFFER_HPP
#include "CLBuffer.hpp"
namespace tcl
{
/**
* デバイス側で書き込みのみできるバッファ
*/
class CLWriteBuffer : public CLBuffer
{
public:
/**
* デバイス側で書き込みのみできるバッファ
* \param[in] data 実行後に転送対象になる配列
*/
template <typename T>
CLWriteBuffer(std::vector<T>& data)
: CLBuffer(CL_MEM_WRITE_ONLY, data) { }
/**
* デバイス側で書き込みのみできるバッファ
* \param[in] data 実行後に転送対象になる配列
*/
template <typename T, size_t NUM>
CLWriteBuffer(std::array<T, NUM>& data)
: CLBuffer(CL_MEM_WRITE_ONLY, data) { }
/**
* デバイス側で書き込みのみできるバッファ
* \param[in] data 実行後に転送対象になるデータ
*/
template <typename T>
CLWriteBuffer(T& data)
: CLBuffer(CL_MEM_WRITE_ONLY, data) { }
/**
* デバイス側で書き込みのみできるバッファ
* \param[in] data 実行後に転送対象になる配列データのアドレス
* \param[in] num 書き込みたいデータの個数
*/
template <typename T>
CLWriteBuffer(T* data, const size_t& num)
: CLBuffer(CL_MEM_WRITE_ONLY, data, num) { }
virtual ~CLWriteBuffer() {}
};
}
#endif