- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a naive question about that why there is only float array copy .
Is the time cost of integer array copy much smaller than float number copy?
Best Regards,
Jiajun
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If we are just copying (no scaling), there is no difference between integer vs. float. We copy bits from one memory location to another and it does not mater what those bits represent (integer/float/string/etc..). memcpy can be used for this operation. If you really want to use MKL, you can typecast your 32bit integer pointers to float* and call scopy. Similarly, you can typecast your 64bit integer pointers to doubles* and call dcopy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel Fortran and C++ compilers would likely substitute intel_fast_memcpy when optimizing a single isolated loop. MKL ?copy have a potential higher bandwidth when parallelizing internally across multiple CPUs, if the source and destination have suitable NUMA locality.
Either an optimized memcpy or MKL ?copy should look for the case where non-temporal streaming store is preferred.
The short answer is that compilers can usually make as good or better choice when the programmer leaves the details to the compilers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Murat Efe Guney (Intel) wrote:
If we are just copying (no scaling), there is no difference between integer vs. float. We copy bits from one memory location to another and it does not mater what those bits represent (integer/float/string/etc..). memcpy can be used for this operation. If you really want to use MKL, you can typecast your 32bit integer pointers to float* and call scopy. Similarly, you can typecast your 64bit integer pointers to doubles* and call dcopy.
I use fortran. It seems that Fortran 95 interface do not support integer copy.
for example
==============
integer a(10),b(10)
call copy(a,b)
==============
It doesn't work.
But f77 interface works.
==============
call scopy(10,a,1,b,1)
==============
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you would have to add the corresponding interface block to blas.f90 (and disable warn_interfaces) to persuade the compiler to use the scopy or dcopy for integer types.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page