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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:07:01+00:00 2026-05-23T05:07:01+00:00

I notice some of the npp functions has an argument *pDeviceBuffer. I am wondering

  • 0

I notice some of the npp functions has an argument *pDeviceBuffer. I am wondering what this argument is for and how I shall set it while using the functions. Also, the results of functions,such as nppsMax_32f, are written back to a pointer. Is the memory on host or device memory? Thank you.

  • 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-05-23T05:07:02+00:00Added an answer on May 23, 2026 at 5:07 am

    pDeviceBuffer is used as scratch space inside npp. Scratch space is usually allocated internally (like in CUFFT). But some of these operations (sum, min, max) are so quick that allocating the scratch space itself might become a bottleneck. Querying for the scratch space required and then allocating it once before re-using it multiple times would be a good idea.

    Example:
    Let’s say you have a very large array that you want to get min max and sum from, you will need to do the following.

    int n = 1e6, bytes = 0;
    nppsReductionGetBufferSize_32f(n, &bytes);
    Npp8u *scratch = nppsMalloc_8f(bytes);
    nppsMax_32f(in, n, max_val, nppAlgHintNone, scratch);
    // Reusing scratch space for input of same size
    nppsMin_32f(in, n, min_val, nppAlgHintNone, scratch);
    // Reusing scratch space for input of smaller size
    nppsSum_32f(in, 1e4, sum_val, nppAlgHintNone, scratch); 
    // Larger inputs may require more scratch space. 
    // So you may need to check and allocate appropriate space
    int newBytes = 0; nppsReductionGetBufferSize_32f(5e6, &newBytes);
    if (bytes != newBytes) {
         nppsFree(scratch);
         scratch = nppsMalloc_8u(bytes);
    }
    nppsSum_32f(in, 5e6, sum_val, nppAlgHintNone, scratch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I notice that some of the base applications in Android are using this little
why some thing like this url=http:/+www.pathname.com+/+anotherString; turns into http://www.pathname.com/anotherString . Notice the // after
I am doing some exercises in my object-oriented javascript book, I notice that this:
My basic use case is do some processing, set flash[:notice] , and then redirect
While browsing the code of some websites I sometimes notice that some JavaScript files
I'm a little confused by this. I notice that some web APIs use the
i notice some webpage display images using php scripts. how do i do that
We are debugging some performace problems and have notice some strange results from stopwatch.
Once in a while, I notice some coding pattern that I've had for years
This (or some variation of it) is output by my PHP script Notice that

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.