<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic   in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982524#M17508</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Sergey Kostrov wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;gt;&amp;gt;...the &lt;STRONG&gt;mkl_free&lt;/STRONG&gt;( some_matrix )&lt;/P&gt;

&lt;P&gt;It is not enough and more technical details are needed.&lt;/P&gt;

&lt;P&gt;&amp;gt;&amp;gt;...What are the reasons that can cause it to fail?&lt;/P&gt;

&lt;P&gt;Please provide an example of how you use MKL functions.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Hi Sergey,&lt;BR /&gt;
	I revive this old post because I have some problems with mkl_free that throws exceptions and I disagree with your answers.&lt;BR /&gt;
	Compared to all of you I'm a ultra-novice programmer, but I heard that, if I have to write a function/method, I have two choices:&lt;BR /&gt;
	1 - make it exception free&lt;BR /&gt;
	2 - don't make it exception free&lt;BR /&gt;
	If 1 applies then we would be all happy.&lt;BR /&gt;
	If 2 applies I have two choices:&lt;BR /&gt;
	2a - my software is open-source and I don't want to support any user that would use my library/program. I could say:&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "An exception is thrown? P**s off, and give a look at the definition yourself"&lt;BR /&gt;
	2b - my software is closed, I sell it, I make a lot of money and just because of this I provide a rich documentation about every single exception that can be thrown.&lt;BR /&gt;
	No matter "how you use MKL functions", no matter about "technical details" of the end-user program.&lt;BR /&gt;
	It's true: at 99% the user is wrong. He misused the function, he messed up everything, etc... but let him discover his own mistakes ! Let him debug his own code! Don't give him bread. Give him the tools needed to grow wheat.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Having said that, I might be wrong and if so I'm sorry, but if not, please think about it.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2015 17:06:01 GMT</pubDate>
    <dc:creator>DarioMangoni</dc:creator>
    <dc:date>2015-10-28T17:06:01Z</dc:date>
    <item>
      <title>For what reasons can mkl_free() fail?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982519#M17503</link>
      <description>&lt;P&gt;I am working with Intel's MKL in C++ and I get a lot of runtime errors with themkl_free(some_matrix);&amp;nbsp;call. Usually, it just hangs when it reaches the matrix. What are the reasons that can cause it to fail?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2013 23:05:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982519#M17503</guid>
      <dc:creator>Po</dc:creator>
      <dc:date>2013-08-23T23:05:48Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...the mkl_free( some</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982520#M17504</link>
      <description>&amp;gt;&amp;gt;...the &lt;STRONG&gt;mkl_free&lt;/STRONG&gt;( some_matrix )

It is not enough and more technical details are needed.

&amp;gt;&amp;gt;...What are the reasons that can cause it to fail?

Please provide an example of how you use MKL functions.</description>
      <pubDate>Sun, 25 Aug 2013 19:22:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982520#M17504</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-08-25T19:22:49Z</dc:date>
    </item>
    <item>
      <title>Thanks for your reply Sergey.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982521#M17505</link>
      <description>&lt;P&gt;Thanks for your reply Sergey. I am using MS Visual Studio 2008 to build with MKL 11.0.5. When I run the application in Release mode, the program simply hangs so I was looking for ideas on how to debug the issue. A sample of the mkl_free() call can be found here on line 1464:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://github.com/poliu2s/MKL/blob/master/MultiObjModelToUSReg/OptimizeShapeAndPoseCoef.cpp#L1464" target="_blank"&gt;https://github.com/poliu2s/MKL/blob/master/MultiObjModelToUSReg/OptimizeShapeAndPoseCoef.cpp#L1464&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sun, 25 Aug 2013 22:38:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982521#M17505</guid>
      <dc:creator>Po</dc:creator>
      <dc:date>2013-08-25T22:38:03Z</dc:date>
    </item>
    <item>
      <title>Could you please prepare the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982522#M17506</link>
      <description>&lt;P&gt;Could you please prepare the standalone example shows the problem? the example you provided cannot be compiled.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 06:53:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982522#M17506</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-08-26T06:53:50Z</dc:date>
    </item>
    <item>
      <title>Could you comment everything</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982523#M17507</link>
      <description>Could you comment everything between these two blocks in order to very that simple allocation-deallocation works without any problems?

void &lt;STRONG&gt;Registration::multiObjectAtlasShapeCoefFunction&lt;/STRONG&gt;( ... )
{
...
// Initialize some variables
double* Tr = (double*)mkl_malloc(4 * 4 * sizeof(double), 64);
double* Tr2 = (double*)mkl_malloc(4 * 4 * sizeof(double), 64);
...
/*
Comment all codes between allocations and deallocations
*/
...
cout &amp;lt;&amp;lt; "Before free" &amp;lt;&amp;lt; endl;
// Free all local variables
mkl_free_buffers();
cout &amp;lt;&amp;lt; "a" &amp;lt;&amp;lt; endl;
mkl_free(Tr);		// fails to free
cout &amp;lt;&amp;lt; "b" &amp;lt;&amp;lt; endl;
mkl_free(Tr2);
// cout &amp;lt;&amp;lt; "c" &amp;lt;&amp;lt; endl;
// mkl_free(pose_feature_transform);
// cout &amp;lt;&amp;lt; "d" &amp;lt;&amp;lt; endl;
// mkl_free(pose_feature_transform2);
// cout &amp;lt;&amp;lt; "e" &amp;lt;&amp;lt; endl;
// mkl_free(ones);
// cout &amp;lt;&amp;lt; "f" &amp;lt;&amp;lt; endl;
// mkl_free(part1);
// cout &amp;lt;&amp;lt; "g" &amp;lt;&amp;lt; endl;
// mkl_free(part2);
// cout &amp;lt;&amp;lt; "h" &amp;lt;&amp;lt; endl;
// mkl_free(part1_2);
// cout &amp;lt;&amp;lt; "done." &amp;lt;&amp;lt; endl;
}

Then, start uncommenting line-by-line with verifications of binaries ( in Debug and Release configurations ) until you reproduce the problem. If you manage to reproduce it follow these simple steps a last uncommented piece of codes is where the problem is.</description>
      <pubDate>Tue, 27 Aug 2013 04:26:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982523#M17507</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-08-27T04:26:31Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982524#M17508</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Sergey Kostrov wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;gt;&amp;gt;...the &lt;STRONG&gt;mkl_free&lt;/STRONG&gt;( some_matrix )&lt;/P&gt;

&lt;P&gt;It is not enough and more technical details are needed.&lt;/P&gt;

&lt;P&gt;&amp;gt;&amp;gt;...What are the reasons that can cause it to fail?&lt;/P&gt;

&lt;P&gt;Please provide an example of how you use MKL functions.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Hi Sergey,&lt;BR /&gt;
	I revive this old post because I have some problems with mkl_free that throws exceptions and I disagree with your answers.&lt;BR /&gt;
	Compared to all of you I'm a ultra-novice programmer, but I heard that, if I have to write a function/method, I have two choices:&lt;BR /&gt;
	1 - make it exception free&lt;BR /&gt;
	2 - don't make it exception free&lt;BR /&gt;
	If 1 applies then we would be all happy.&lt;BR /&gt;
	If 2 applies I have two choices:&lt;BR /&gt;
	2a - my software is open-source and I don't want to support any user that would use my library/program. I could say:&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "An exception is thrown? P**s off, and give a look at the definition yourself"&lt;BR /&gt;
	2b - my software is closed, I sell it, I make a lot of money and just because of this I provide a rich documentation about every single exception that can be thrown.&lt;BR /&gt;
	No matter "how you use MKL functions", no matter about "technical details" of the end-user program.&lt;BR /&gt;
	It's true: at 99% the user is wrong. He misused the function, he messed up everything, etc... but let him discover his own mistakes ! Let him debug his own code! Don't give him bread. Give him the tools needed to grow wheat.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Having said that, I might be wrong and if so I'm sorry, but if not, please think about it.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 17:06:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/For-what-reasons-can-mkl-free-fail/m-p/982524#M17508</guid>
      <dc:creator>DarioMangoni</dc:creator>
      <dc:date>2015-10-28T17:06:01Z</dc:date>
    </item>
  </channel>
</rss>

