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 8136425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:45:24+00:00 2026-06-06T10:45:24+00:00

I have a problem with the following code, when executing the call to cublasSrotg

  • 0

I have a problem with the following code, when executing the call to cublasSrotg it throws an exception: “Access violation writing location 0x05200600”, which is the address of the ‘dA’ pointer. When running the debugger it appears to be skipping the call to cudaMalloc, but I can’t figure out what I’m doing wrong.

cublasHandle_t handle;
cublasCreate(&handle);
float hA[SIZE] = { 1.0f, 2.0f, 3.0f, 4.0f };
int sizef = sizeof(float);
float* dA;
cudaMalloc((void**)&dA, SIZE * sizef);
cublasSetVector(SIZE, sizef, hA, 1, dA, 1);
float s, c;
cublasSrotg(handle, dA, dA + N, &c, &s);
cublasSrot(handle, N, dA, 1, dA + N, 1, &c, &s);
cublasGetVector(SIZE, sizef, dA, 1, hA, 1);
...
  • 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-06T10:45:25+00:00Added an answer on June 6, 2026 at 10:45 am

    From the following line of code I gather that SIZE is equal to 4.

    float hA[SIZE] = { 1.0f, 2.0f, 3.0f, 4.0f };
    

    But then here, you do two strange things:

    cublasSrotg(handle, dA, dA + N, &c, &s);
    
    1. You mix host and device parameters to the same cublas function (I don’t know if this is legal or not). dA is a device pointer and s and c are host variables.

    2. You pass dA and dA + N. Unless N is less than 4, you will be indexing out of bounds, so that could be your problem. Also, note that the first two inputs to cublasSrotg are in/out variables — their initial value is used, but then overwritten.

    Since they are overwritten, it’s strange that you would then pass the same pointers to cublasSrot…

    See the CUBLAS Documentation for full details.

    Edit:

    OP reveals that the problem was mixing device and host pointers, as well as not calling cudaMalloc to allocate the c and s values on the device.

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

Sidebar

Related Questions

The following code summarizes the problem I have at the moment. My current execution
I have a problem with the following code: protected void onDraw(Canvas canvas) { Paint
i am new in JSP,i have some problem with the following code : <%@
I have the following code, and i have a problem regarding changing the ringtone
Never thought I'd have this problem :) The following snippet of code works in
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
I have an understanding problem of how the following code works: XMLInputFactory xif =
am new here. i have a slight problem; PLease look at the following code
I have the following code: The actual problem is the non-quoted code. I want
I have the following code I want to run, but the problem is $this->type

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.