<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">MKL fails  on gemms calls too. At least in the past, not sure about the latest version.  <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 1, 2020, at 10:48 PM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com" class="">jeff.science@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I assume it's MKL sparse that fails for empty matrices, because the BLAS and LAPACK should follow the Netlib convention.<div class=""><br class=""></div><div class="">I'm sorry that MKL is unwilling to do nothing for you :-)<br class=""><div class=""><br class=""></div><div class=""><div class="">Jeff</div></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 30, 2020 at 4:26 PM Mills, Richard Tran via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div class="">
Thanks for the replies, everyone. It suppose is not actually that hard for me to handle these dimensions properly -- I just hadn't personally encountered or thought much about when such operations with empty matrices might arise, and was initially puzzled about
 what multiplication by an "empty" matrix even means. I think I see now why I need to put in the work to handle these cases properly. (Sure wish that MKL could just do it, though!)<br class="">
<br class="">
--Richard<br class="">
<br class="">
<div class="">On 5/30/20 4:09 PM, Stefano Zampini wrote:<br class="">
</div>
<blockquote type="cite" class="">
<pre class=""></pre>
<blockquote type="cite" class="">
<pre class="">On May 31, 2020, at 1:03 AM, Jed Brown <a href="mailto:jed@jedbrown.org" target="_blank" class=""><jed@jedbrown.org></a> wrote:

Stefano Zampini <a href="mailto:stefano.zampini@gmail.com" target="_blank" class=""><stefano.zampini@gmail.com></a> writes:

</pre>
<blockquote type="cite" class="">
<pre class="">If A is 0x8 and B is 8x5 then C is correct to be of size 0x5. The rows and columns of the resulting matrix have to follow the rules.
</pre>
</blockquote>
<pre class="">Right, I think if you said C is 0x0 (which seems like Richard's proposal), you'd need to relax shape compatibility logic in many places, including in ways that might produce confusing errors.

</pre>
</blockquote>
<pre class="">Richard

In the triple matrix product case, your code will break, because the operation will no longer be associative

A 3x0, B 0x8, C 8x7 -> (ABC) is a valid 3x7 matrix (empty) 

If I understand you right, (AB)  would be  a 0x0 matrix, and it can no longer be multiplied against C

</pre>
<blockquote type="cite" class="">
<pre class="">Richard, what is the hardship in preserving the shape relations?
</pre>
</blockquote>
<pre class=""></pre>
</blockquote>
<br class="">
</div>

</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature">Jeff Hammond<br class=""><a href="mailto:jeff.science@gmail.com" target="_blank" class="">jeff.science@gmail.com</a><br class=""><a href="http://jeffhammond.github.io/" target="_blank" class="">http://jeffhammond.github.io/</a></div>
</div></blockquote></div><br class=""></body></html>