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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:45:36+00:00 2026-06-13T15:45:36+00:00

I am using cusp for sparse matrix multiplication. From the resultant matrix i need

  • 0

I am using cusp for sparse matrix multiplication. From the resultant matrix i need the max value without copying the matrix from device memory to host memory. I am planning to wrap the resultant matrix in thrust device pointer and then use the function thrust::max_element to get max element. The matrices are in coo format. If C is resultant sparse matrix then
C.row_indices[] : contains row number
C.column_indices[]: contains column number
C.values[]: contain actual value

So basically i need highest value from C.values array.
Using

thrust::device_ptr<int> dev_ptr = C.values;

is giving error

error: no instance of constructor "thrust::device_ptr<T>::device_ptr [with T=int]" matches the argument list
 argument types are: (cusp::array1d<float, cusp::host_memory>)

How can i wrap my resultant matrix in order to use it in thrust 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-13T15:45:37+00:00Added an answer on June 13, 2026 at 3:45 pm

    If my device matrix definition is like this:

    cusp::coo_matrix<int, double, cusp::device_memory> A_d = A;
    

    Then try this:

    thrust::device_ptr<double> dev_ptr = &(A_d.values[0]);
    thrust::device_ptr<double> max_ptr = thrust::max_element(dev_ptr, dev_ptr + 6);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using jQuery, how do I get the value from a textbox and then load
Using R, what is the best way to read a symmetric matrix from a
Using sharedpreferences I save a value. I need to set this value (duration) to
Using Android NDK is it possible (from native C-code) to get a list of
Using JQuery,Is there any possible to capture images/scanned documents from digital Camera/Scanner Connected to
Using MATLAB, you have to start with a uniform distribution between (0,1). You need
Using C# How can I show a document in richtextbox without scrollbars, But I
Using MySQL for basic storage of system/user data. I need to store/search messages (adding
Using CMake I want to check if a particular function (cv::getGaborKernel) from OpenCV library
Using Django, how do I generate the value of a field the first time

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.