{"id":4198,"date":"2012-03-14T01:40:52","date_gmt":"2012-03-14T00:40:52","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=4198"},"modified":"2012-03-14T01:40:52","modified_gmt":"2012-03-14T00:40:52","slug":"a-bug-in-mathematicas-cudadot-in-version-8-0-1","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=4198","title":{"rendered":"A bug in Mathematica&#8217;s CUDADot in version 8.0.1"},"content":{"rendered":"<p>After writing my recent article on <a href=\"https:\/\/www.walkingrandomly.com\/?p=4167\">GPU accelerated Matrix-Matrix multiplication using Maple<\/a>, I thought that I&#8217;d try the same thing in Mathematica.\u00a0 However, I instantly hit a problem on my 64bit Windows 7 machine running version 8.0.1 of Mathematica.<\/p>\n<pre>In[1]:= a = RandomReal[1, {2, 2}]\r\nOut[1]= {{0.363441, 0.528656}, {0.208881, 0.510232}}\r\n\r\nIn[2]:= b = RandomReal[1, {2, 2}]\r\nOut[2]= {{0.33536, 0.77615}, {0.537533, 0.788522}}\r\n\r\nIn[3]:= Dot[a, b]\r\nOut[3]= {{0.406054, 0.698942}, {0.344317, 0.564452}}\r\n\r\nIn[4]:= Needs[\"CUDALink`\"]\r\nCUDADot[a, b]\r\nOut[5]= {{0.741414, 1.47509}, {0.881849, 1.35297}}<\/pre>\n<p>In short, CUDADot gives the wrong result for floating point numbers (on my machine at least).\u00a0 An upgrade to version 8.0.4 fixed the problem<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After writing my recent article on GPU accelerated Matrix-Matrix multiplication using Maple, I thought that I&#8217;d try the same thing in Mathematica.\u00a0 However, I instantly hit a problem on my 64bit Windows 7 machine running version 8.0.1 of Mathematica. In[1]:= a = RandomReal[1, {2, 2}] Out[1]= {{0.363441, 0.528656}, {0.208881, 0.510232}} In[2]:= b = RandomReal[1, {2, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[44,51,8],"tags":[],"class_list":["post-4198","post","type-post","status-publish","format-standard","hentry","category-cuda","category-gpu","category-mathematica"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-15I","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/4198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4198"}],"version-history":[{"count":2,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/4198\/revisions"}],"predecessor-version":[{"id":4208,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/4198\/revisions\/4208"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}