37:
public Arcane::impl::SpecificMemoryCopyBase<DataType, Extent>
39 using BaseClass = Arcane::impl::SpecificMemoryCopyBase<DataType, Extent>;
40 using BaseClass::_toTrueType;
44 using BaseClass::m_extent;
48 void copyFrom(
const IndexedMemoryCopyArgs& args)
override
50 _copyFrom(args.m_queue, args.m_indexes, _toTrueType(args.m_source), _toTrueType(args.m_destination));
53 void copyTo(
const IndexedMemoryCopyArgs& args)
override
55 _copyTo(args.m_queue, args.m_indexes, _toTrueType(args.m_source), _toTrueType(args.m_destination));
58 void fill(
const IndexedMemoryCopyArgs& args)
override
60 _fill(args.m_queue, args.m_indexes, _toTrueType(args.m_source), _toTrueType(args.m_destination));
63 void copyFrom(
const IndexedMultiMemoryCopyArgs& args)
override
65 _copyFrom(args.m_queue, args.m_indexes, args.m_multi_memory, _toTrueType(args.m_source_buffer));
68 void copyTo(
const IndexedMultiMemoryCopyArgs& args)
override
70 _copyTo(args.m_queue, args.m_indexes, args.m_const_multi_memory, _toTrueType(args.m_destination_buffer));
73 void fill(
const IndexedMultiMemoryCopyArgs& args)
override
75 _fill(args.m_queue, args.m_indexes, args.m_multi_memory, _toTrueType(args.m_source_buffer));
90 const Int64 sub_size = m_extent.v;
96 Int64 zindex = i * sub_size;
97 Int64 zci = indexes[i] * sub_size;
98 for (
Int32 z = 0; z < sub_size; ++z)
99 destination[zindex + z] = source[zci + z];
116 const Int32 nb_index = indexes.
size() / 2;
119 const Int32 sub_size = m_extent.v;
125 Int32 index0 = indexes[i * 2];
126 Int32 index1 = indexes[(i * 2) + 1];
128 auto* orig_view_data =
reinterpret_cast<DataType*
>(orig_view_bytes.data());
134 for (
Int32 z = 0, n = sub_size; z < n; ++z)
135 orig_view[zci + z] = source[z_index + z];
154 const Int32 sub_size = m_extent.v;
155 constexpr Int32 max_size = 24;
160 if (sub_size > max_size)
162 sizeof(DataType) * sub_size,
sizeof(DataType) * max_size);
164 for (
Int32 z = 0; z < sub_size; ++z)
165 local_source[z] = source[z];
166 for (
Int32 z = sub_size; z < max_size; ++z)
167 local_source[z] = {};
176 Int64 zci = i * sub_size;
177 for (
Int32 z = 0; z < sub_size; ++z)
178 destination[zci + z] = local_source[z];
185 Int64 zci = indexes[i] * sub_size;
186 for (
Int32 z = 0; z < sub_size; ++z)
187 destination[zci + z] = local_source[z];
205 const Int32 nb_index = indexes.
size() / 2;
208 const Int32 sub_size = m_extent.v;
209 constexpr Int32 max_size = 24;
214 if (sub_size > max_size)
216 sizeof(DataType) * sub_size,
sizeof(DataType) * max_size);
218 for (
Int32 z = 0; z < sub_size; ++z)
219 local_source[z] = source[z];
220 for (
Int32 z = sub_size; z < max_size; ++z)
221 local_source[z] = {};
228 const Int32 nb_dim1 = multi_views.size();
229 for (
Int32 zz = 0; zz < nb_dim1; ++zz) {
230 Span<DataType> orig_view = Arccore::asSpan<DataType>(multi_views[zz]);
236 orig_view[i] = local_source[i % sub_size];
245 Int32 index0 = indexes[i * 2];
246 Int32 index1 = indexes[(i * 2) + 1];
247 Span<std::byte> orig_view_bytes = multi_views[index0];
248 auto* orig_view_data =
reinterpret_cast<DataType*
>(orig_view_bytes.data());
251 Span<DataType> orig_view = { orig_view_data, orig_view_bytes.
size() / (
Int64)
sizeof(DataType) };
252 Int64 zci = ((
Int64)(index1)) * sub_size;
253 for (Int32 z = 0, n = sub_size; z < n; ++z)
254 orig_view[zci + z] = local_source[z];
259 void _copyTo(RunQueue* queue, SmallSpan<const Int32> indexes, Span<const DataType> source,
260 Span<DataType> destination)
268 Int32 nb_index = indexes.size();
269 const Int64 sub_size = m_extent.v;
275 Int64 zindex = i * sub_size;
276 Int64 zci = indexes[i] * sub_size;
277 for (Int32 z = 0; z < sub_size; ++z)
278 destination[zci + z] = source[zindex + z];
282 void _copyTo(RunQueue* queue, SmallSpan<const Int32> indexes, SmallSpan<
const Span<const std::byte>> multi_views,
283 Span<DataType> destination)
296 const Int32 nb_index = indexes.size() / 2;
299 const Int32 sub_size = m_extent.v;
305 Int32 index0 = indexes[i * 2];
306 Int32 index1 = indexes[(i * 2) + 1];
307 Span<const std::byte> orig_view_bytes = multi_views[index0];
308 auto* orig_view_data =
reinterpret_cast<const DataType*
>(orig_view_bytes.data());
311 Span<const DataType> orig_view = { orig_view_data, orig_view_bytes.size() / (
Int64)
sizeof(DataType) };
312 Int64 zci = ((
Int64)(index1)) * sub_size;
313 Int64 z_index = (
Int64)i * sub_size;
314 for (Int32 z = 0, n = sub_size; z < n; ++z)
315 destination[z_index + z] = orig_view[zci + z];