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

Method set_range

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

Source from the content-addressed store, hash-verified

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

Callers 1

scatterFunction · 0.45

Calls 2

iterator_range_sizeFunction · 0.85
get_indexMethod · 0.45

Tested by

no test coverage detected