Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:33:46+00:00 2026-06-12T22:33:46+00:00

While using BLAS DGEMM matrix-multiply function, I noticed that for an uninitialized result matrix

  • 0

While using BLAS DGEMM matrix-multiply function, I noticed that for an uninitialized result matrix C, I get NaNs in the resultwhen I call it like so:

DGEMM('N', 'N', M, N, K, 1.0, A, LDA, B, LDB, 0.0, C, LDC)

However, if I declare ALPHA and BETA before-hand:

REAL*8 ALPHA, BETA
PARAMETER (ALPHA=1.0)
PARAMETER (BETA=0.0)

DGEMM('N', 'N', M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)

then the multiplication works okay. Does anyone have any ideas as to why declaring the arguments works?

Note that I’m using the Intel Fortran compiler along with it’s MKL library.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:33:47+00:00Added an answer on June 12, 2026 at 10:33 pm

    It would work if you passed alpha and beta as double precision numerical constants (eg, 1.d0), but you’re passing it single precision constants, and Fortran 77 has no way of knowing dgemm’s argument list and promoting the reals to double precision. (It might work with the single precision constants if you used MKL’s Fortran 95 interface, but I’m not sure).

    Because you’re only passing pointers 4-byte arguments and the library subroutine is looking up 8-byte values, the rest of the calculation gets messed up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While using jCart I noticed that it did not work on the iPhone. After
While using the maven-buildnumber-plugin 1.0 beta 4, it seems that I can get the
While using jQuery's autocomplete, I've noticed that characters & and ' are escaped as
While using doctrine, I noticed that, to delete an entity, I need to retrieve
While using princomp() function in R, the following error is encountered : covariance matrix
While using cURL with some site, I noticed that some files that I requested
while using g.drawImage(img,0,0,100,100,0,0,0,0,null) it does not produce any result. So how to draw on
While using the repository module I noticed Attribute and Values in module setting. What
While using Vim I'll sometimes want to look at a function definition or a
While using SubSonic 3 I wrote the below. I thought I would get user_ref

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.