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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:03:34+00:00 2026-06-02T16:03:34+00:00

I have a kernel which produces an array of result values and I want

  • 0

I have a kernel which produces an array of result values and I want to find the maximum of these values efficiently. The Array is initialized in the beginning of the kernel with some negative value (for example -1). The Kernel is executed using 5 blocks each with 256 threads, for example.

Here are the problems:

  1. Because of my data, i must terminate threads, that are not valid, so I am working sometimes with 256 threads, sometimes 50, 20 and so on.

  2. In shared memory are written results from block, but as I mentioned, some array has 50 results, some has 256 results…(so shared array looks like this) 8,6,4,9,1,-1,-1,-1…

  3. In that case how to efficiently find the maximum in one block ?

Parallel reduction will be complicated on these types of array, isn’t it ? How to do this ?

  • 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-02T16:03:35+00:00Added an answer on June 2, 2026 at 4:03 pm

    There is not enough information about your algorithm.

    What do you mean by n results?
    Are the ignored values in the array set to -1 or do you use dynamic extern shared memory and threads only write up to index n (sounds hard to realize)?

    • Use a fixed size shared memory and set ignored values to -1 and still perform parallel reduction, if you search positive maximum and its filled with -1 it doesn’t matter, or

    • Don’t terminate threads, instead set a flag in another array if thread should not perform further calculations and still do parallel reduction

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

Sidebar

Related Questions

I have some services which i want to be able to publish and subscribe
I have created local linux kernel git repository from which I want to check
I am writing a kernel module in which i have 3 source files and
I have a kernel service driver , i want to install it with an
I have a kernel module in which I deal with USB devices. It happens
I have a Linux kernel module M1 which exports a symbol S1 . When
I have a buggy kernel module which I am trying to fix. Basically when
I have a kernel which runs twice with different grid size. My problem is
I have a CUDA kernel which I'm compiling to a cubin file without any
I have an app which uses btouch'd bindings for WEPopover. You can find the

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.