- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am wondering whether the code blow will trigger a temporary array allocation and data copying for array "ima". I compiled with "-check arg_tmp_created" and "-warn all" but did not get any message.
Program Test use blas95 !!mkl blas real(kind=8), allocatable :: rmb(:,:), rmc(:,:) integer(kind=2), allocatable :: ima(:,:) call gemm(A=real(imA,kind=8),B=RMB,C=RMc) End Program Test
Since the array passed can be of substantial size a temporary array may cause a massive overhead.
Any suggestions appreciated.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unless you are providing source code for inlining gemm, it looks like not even a slim possibility to avoid generating a full array copy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think that in this case the temporary comes from the call to the intrinsic function real.
I do not think that the -check_arg_tmp_created can detect the temporaries created in these cases.
The flag seems to capture only the temporaries created as a result of passing a non-contiguous array to a procedure.
https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/798195
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You've asked the compiler to create a copy of ima with the integers converted to reals. By what mechanism do you think it could avoid a copy? If there was a version of gemm that accepted integer for the type of the first array, then you wouldn't use the conversion.
The compiler knows how to do multiplication of reals by smallish integer constants in an efficient manner, but that doesn't work for variables.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page