MCPcopy Create free account
hub / github.com/boostorg/compute / set_range

Method set_range

include/boost/compute/algorithm/scatter.hpp:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 {}
34
35 void set_range(InputIterator first,
36 InputIterator last,
37 MapIterator map,
38 OutputIterator result)
39 {
40 m_count = iterator_range_size(first, last);
41 m_input_offset = first.get_index();
42 m_output_offset = result.get_index();
43
44 m_input_offset_arg = add_arg<uint_>("input_offset");
45 m_output_offset_arg = add_arg<uint_>("output_offset");
46
47 *this <<
48 "const uint i = get_global_id(0);\n" <<
49 "uint i1 = " << map[expr<uint_>("i")] <<
50 " + output_offset;\n" <<
51 "uint i2 = i + input_offset;\n" <<
52 result[expr<uint_>("i1")] << "=" <<
53 first[expr<uint_>("i2")] << ";\n";
54 }
55
56 event exec(command_queue &queue)
57 {

Callers 1

scatterFunction · 0.45

Calls 2

iterator_range_sizeFunction · 0.85
get_indexMethod · 0.45

Tested by

no test coverage detected