43 using BaseClass::_toTrueType;
47 using BaseClass::m_extent;
51 void copyFrom(
const IndexedMemoryCopyArgs& args)
override
53 _copyFrom(args.m_queue, args.m_indexes, _toTrueType(args.m_source), _toTrueType(args.m_destination));
56 void copyTo(
const IndexedMemoryCopyArgs& args)
override
58 _copyTo(args.m_queue, args.m_indexes, _toTrueType(args.m_source), _toTrueType(args.m_destination));
61 void fill(
const IndexedMemoryCopyArgs& args)
override
63 _fill(args.m_queue, args.m_indexes, _toTrueType(args.m_source), _toTrueType(args.m_destination));
66 void copyFrom(
const IndexedMultiMemoryCopyArgs& args)
override
68 _copyFrom(args.m_queue, args.m_indexes, args.m_multi_memory, _toTrueType(args.m_source_buffer));
71 void copyTo(
const IndexedMultiMemoryCopyArgs& args)
override
73 _copyTo(args.m_queue, args.m_indexes, args.m_const_multi_memory, _toTrueType(args.m_destination_buffer));
76 void fill(
const IndexedMultiMemoryCopyArgs& args)
override
78 _fill(args.m_queue, args.m_indexes, args.m_multi_memory, _toTrueType(args.m_source_buffer));
86 ARCCORE_CHECK_POINTER(queue);
88 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, indexes.
data());
89 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, source.data());
90 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, destination.
data());
93 const auto extent = m_extent;
99 Int64 zindex = i * extent.size();
101 for (
Int32 z = 0; z < extent.v; ++z)
102 destination[zindex + z] = source[zci + z];
109 ARCCORE_CHECK_POINTER(queue);
111 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, indexes.
data());
112 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, source.data());
113 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, multi_views.data());
118 const Int32 nb_index = indexes.
size() / 2;
119 const auto extent = m_extent;
125 Int32 index0 = indexes[i * 2];
126 Int64 index1 = indexes[(i * 2) + 1];
128 auto* orig_view_data =
reinterpret_cast<DataType*
>(orig_view_bytes.data());
131 Span<DataType> orig_view = { orig_view_data, orig_view_bytes.size() / (
Int64)
sizeof(DataType) };
132 Int64 zci = index1 * extent.v;
133 Int64 z_index = i * extent.size();
134 for (
Int32 z = 0, n = extent.v; z < n; ++z)
135 orig_view[zci + z] = source[z_index + z];
147 ARCCORE_CHECK_POINTER(queue);
149 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, indexes.
data());
150 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, destination.
data());
154 const auto extent = m_extent;
155 constexpr Int32 max_size = 24;
160 if (extent.v > max_size)
162 sizeof(DataType) * extent.v,
sizeof(DataType) * max_size);
164 for (
Int32 z = 0; z < extent.v; ++z)
165 local_source[z] = source[z];
166 for (
Int32 z = extent.v; z < max_size; ++z)
167 local_source[z] = {};
172 Int32 nb_value = CheckedConvert::toInt32(destination.
size() / extent.v);
176 Int64 zci = i * extent.size();
177 for (
Int32 z = 0; z < extent.v; ++z)
178 destination[zci + z] = local_source[z];
186 for (
Int32 z = 0; z < extent.v; ++z)
187 destination[zci + z] = local_source[z];
195 ARCCORE_CHECK_POINTER(queue);
198 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, indexes.
data());
200 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, multi_views.data());
205 const Int32 nb_index = indexes.
size() / 2;
206 const auto extent = m_extent;
207 constexpr Int32 max_size = 24;
212 if (extent.v > max_size)
214 sizeof(DataType) * extent.v,
sizeof(DataType) * max_size);
216 for (
Int32 z = 0; z < extent.v; ++z)
217 local_source[z] = source[z];
218 for (
Int32 z = extent.v; z < max_size; ++z)
219 local_source[z] = {};
227 const Int32 nb_dim1 = multi_views.size();
228 for (
Int32 zz = 0; zz < nb_dim1; ++zz) {
230 Int32 nb_value = CheckedConvert::toInt32(orig_view.
size());
235 orig_view[i] = local_source[i % extent.v];
244 Int32 index0 = indexes[i * 2];
245 Int64 index1 = indexes[(i * 2) + 1];
246 Span<std::byte> orig_view_bytes = multi_views[index0];
247 auto* orig_view_data =
reinterpret_cast<DataType*
>(orig_view_bytes.data());
250 Span<DataType> orig_view = { orig_view_data, orig_view_bytes.size() / (
Int64)
sizeof(DataType) };
251 Int64 zci = index1 * extent.v;
252 for (
Int32 z = 0, n = extent.v; z < n; ++z)
253 orig_view[zci + z] = local_source[z];
258 void _copyTo(
const RunQueue* queue, SmallSpan<const Int32> indexes, Span<const DataType> source,
259 Span<DataType> destination)
261 ARCCORE_CHECK_POINTER(queue);
263 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, indexes.data());
264 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, source.data());
265 ARCCORE_CHECK_ACCESSIBLE_POINTER(queue, destination.data());
267 Int32 nb_index = indexes.size();
268 const auto extent = m_extent;
274 Int64 zindex = i * extent.size();
275 Int64 zci = indexes[i] * extent.v;
276 for (
Int32 z = 0; z < extent.v; ++z)
277 destination[zci + z] = source[zindex + z];
280 void _copyTo(
const RunQueue* queue, SmallSpan<const Int32> indexes, SmallSpan<
const Span<const std::byte>> multi_views,
281 Span<DataType> destination)
283 ARCCORE_CHECK_POINTER(queue);
286 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, indexes.data());
287 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, destination.data());
288 ARCCORE_CHECK_ACCESSIBLE_POINTER_ALWAYS(queue, multi_views.data());
294 const Int32 nb_index = indexes.size() / 2;
295 const auto extent = m_extent;
301 Int32 index0 = indexes[i * 2];
302 Int64 index1 = indexes[(i * 2) + 1];
303 Span<const std::byte> orig_view_bytes = multi_views[index0];
304 auto* orig_view_data =
reinterpret_cast<const DataType*
>(orig_view_bytes.data());
307 Span<const DataType> orig_view = { orig_view_data, orig_view_bytes.size() / (
Int64)
sizeof(DataType) };
308 Int64 zci = index1 * extent.v;
309 Int64 z_index = i * extent.size();
310 for (
Int32 z = 0, n = extent.v; z < n; ++z)
311 destination[z_index + z] = orig_view[zci + z];