|
62 | 62 | \ |
63 | 63 | if ((from_extent == (ptrdiff_t) local_TYPE_size) \ |
64 | 64 | && (to_extent == (ptrdiff_t) remote_TYPE_size)) { \ |
65 | | - /* copy of contigous data at both source and destination */ \ |
| 65 | + /* copy of contiguous data at both source and destination */ \ |
66 | 66 | MEMCPY(to, from, count *local_TYPE_size); \ |
67 | 67 | } else { \ |
68 | | - /* source or destination are non-contigous */ \ |
| 68 | + /* source or destination are non-contiguous */ \ |
69 | 69 | for (size_t i = 0; i < count; i++) { \ |
70 | 70 | MEMCPY(to, from, local_TYPE_size); \ |
71 | 71 | to += to_extent; \ |
@@ -254,30 +254,37 @@ COPY_TYPE(wchar, wchar_t, 1) |
254 | 254 | /* Table of predefined copy functions - one for each OPAL type */ |
255 | 255 | /* NOTE: The order of this array *MUST* match the order in opal_datatype_basicDatatypes */ |
256 | 256 | conversion_fct_t opal_datatype_copy_functions[OPAL_DATATYPE_MAX_PREDEFINED] = { |
257 | | - (conversion_fct_t) NULL, /* OPAL_DATATYPE_LOOP */ |
258 | | - (conversion_fct_t) NULL, /* OPAL_DATATYPE_END_LOOP */ |
259 | | - (conversion_fct_t) NULL, /* OPAL_DATATYPE_LB */ |
260 | | - (conversion_fct_t) NULL, /* OPAL_DATATYPE_UB */ |
261 | | - (conversion_fct_t) copy_bytes_1, /* OPAL_DATATYPE_INT1 */ |
262 | | - (conversion_fct_t) copy_bytes_2, /* OPAL_DATATYPE_INT2 */ |
263 | | - (conversion_fct_t) copy_bytes_4, /* OPAL_DATATYPE_INT4 */ |
264 | | - (conversion_fct_t) copy_bytes_8, /* OPAL_DATATYPE_INT8 */ |
265 | | - (conversion_fct_t) copy_bytes_16, /* OPAL_DATATYPE_INT16 */ |
266 | | - (conversion_fct_t) copy_bytes_1, /* OPAL_DATATYPE_UINT1 */ |
267 | | - (conversion_fct_t) copy_bytes_2, /* OPAL_DATATYPE_UINT2 */ |
268 | | - (conversion_fct_t) copy_bytes_4, /* OPAL_DATATYPE_UINT4 */ |
269 | | - (conversion_fct_t) copy_bytes_8, /* OPAL_DATATYPE_UINT8 */ |
270 | | - (conversion_fct_t) copy_bytes_16, /* OPAL_DATATYPE_UINT16 */ |
271 | | - (conversion_fct_t) copy_float_2, /* OPAL_DATATYPE_FLOAT2 */ |
272 | | - (conversion_fct_t) copy_float_4, /* OPAL_DATATYPE_FLOAT4 */ |
273 | | - (conversion_fct_t) copy_float_8, /* OPAL_DATATYPE_FLOAT8 */ |
274 | | - (conversion_fct_t) copy_float_12, /* OPAL_DATATYPE_FLOAT12 */ |
275 | | - (conversion_fct_t) copy_float_16, /* OPAL_DATATYPE_FLOAT16 */ |
276 | | - (conversion_fct_t) copy_short_float_complex, /* OPAL_DATATYPE_SHORT_FLOAT_COMPLEX */ |
277 | | - (conversion_fct_t) copy_float_complex, /* OPAL_DATATYPE_FLOAT_COMPLEX */ |
278 | | - (conversion_fct_t) copy_double_complex, /* OPAL_DATATYPE_DOUBLE_COMPLEX */ |
279 | | - (conversion_fct_t) copy_long_double_complex, /* OPAL_DATATYPE_LONG_DOUBLE_COMPLEX */ |
280 | | - (conversion_fct_t) copy_bool, /* OPAL_DATATYPE_BOOL */ |
281 | | - (conversion_fct_t) copy_wchar, /* OPAL_DATATYPE_WCHAR */ |
282 | | - (conversion_fct_t) NULL /* OPAL_DATATYPE_UNAVAILABLE */ |
| 257 | + [OPAL_DATATYPE_LOOP] = (conversion_fct_t) NULL, |
| 258 | + [OPAL_DATATYPE_END_LOOP] = (conversion_fct_t) NULL, |
| 259 | + [OPAL_DATATYPE_LB] = (conversion_fct_t) NULL, |
| 260 | + [OPAL_DATATYPE_UB] = (conversion_fct_t) NULL, |
| 261 | + [OPAL_DATATYPE_INT1] = (conversion_fct_t) copy_bytes_1, |
| 262 | + [OPAL_DATATYPE_INT2] = (conversion_fct_t) copy_bytes_2, |
| 263 | + [OPAL_DATATYPE_INT4] = (conversion_fct_t) copy_bytes_4, |
| 264 | + [OPAL_DATATYPE_INT8] = (conversion_fct_t) copy_bytes_8, |
| 265 | + [OPAL_DATATYPE_INT16] = (conversion_fct_t) copy_bytes_16, |
| 266 | + [OPAL_DATATYPE_UINT1] = (conversion_fct_t) copy_bytes_1, |
| 267 | + [OPAL_DATATYPE_UINT2] = (conversion_fct_t) copy_bytes_2, |
| 268 | + [OPAL_DATATYPE_UINT4] = (conversion_fct_t) copy_bytes_4, |
| 269 | + [OPAL_DATATYPE_UINT8] = (conversion_fct_t) copy_bytes_8, |
| 270 | + [OPAL_DATATYPE_UINT16] = (conversion_fct_t) copy_bytes_16, |
| 271 | + [OPAL_DATATYPE_FLOAT2] = (conversion_fct_t) copy_float_2, |
| 272 | + [OPAL_DATATYPE_FLOAT4] = (conversion_fct_t) copy_float_4, |
| 273 | + [OPAL_DATATYPE_FLOAT8] = (conversion_fct_t) copy_float_8, |
| 274 | + [OPAL_DATATYPE_FLOAT12] = (conversion_fct_t) copy_float_12, |
| 275 | + [OPAL_DATATYPE_FLOAT16] = (conversion_fct_t) copy_float_16, |
| 276 | + [OPAL_DATATYPE_SHORT_FLOAT_COMPLEX] = (conversion_fct_t) copy_short_float_complex, |
| 277 | + [OPAL_DATATYPE_FLOAT_COMPLEX] = (conversion_fct_t) copy_float_complex, |
| 278 | + [OPAL_DATATYPE_DOUBLE_COMPLEX] = (conversion_fct_t) copy_double_complex, |
| 279 | + [OPAL_DATATYPE_LONG_DOUBLE_COMPLEX] = (conversion_fct_t) copy_long_double_complex, |
| 280 | + [OPAL_DATATYPE_BOOL] = (conversion_fct_t) copy_bool, |
| 281 | + [OPAL_DATATYPE_WCHAR] = (conversion_fct_t) copy_wchar, |
| 282 | +#if SIZEOF_LONG == 4 |
| 283 | + [OPAL_DATATYPE_LONG] = (conversion_fct_t)copy_bytes_4, |
| 284 | + [OPAL_DATATYPE_UNSIGNED_LONG] = (conversion_fct_t)copy_bytes_4, |
| 285 | +#elif SIZEOF_LONG == 8 |
| 286 | + [OPAL_DATATYPE_LONG] = (conversion_fct_t)copy_bytes_8, |
| 287 | + [OPAL_DATATYPE_UNSIGNED_LONG] = (conversion_fct_t)copy_bytes_8, |
| 288 | +#endif |
| 289 | + [OPAL_DATATYPE_UNAVAILABLE] = NULL, |
283 | 290 | }; |
0 commit comments