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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:35:42+00:00 2026-05-24T06:35:42+00:00

I have a 3d array containing the non-cubic bounding box of a sparse geometry.

  • 0

I have a 3d array containing the non-cubic bounding box of a sparse geometry.

The array geometry[x][y][z] contains the value 0 if (x,y,z) is part of the computational domain and otherwise 1.

In an attempt to reorder computations I would like to traverse this space using a Hilbert Curve.

The context is optimizing global memory access in a memory-bound GPU program.

How can I implement this?

Update:
I just want to traverse the non-empty cells, as I will only store those (in an array) together with an adjacency list which keeps track of an element’s 19 neighboring nodes.

The computation is simply copying between two arrays:

dst[i] = src[adjacency_map[i]]

This is the propagation phase of a sparse Lattice Boltzmann method, where the physical interpretation is streaming ‘fluid particles’ from a neighboring site.

The more sequential the values in adjacency_map are; the more coalesced memory accesses we hopefully get.

OpenCL kernel:

__kernel void propagation(__global double *dst, __global double *source,
                          __global const int *adjacency_map, const uint max_size)
{
    size_t l = get_global_id(0);

    if( l > max_size ) 
        return;

    dst[l] = src[adjacency_map[l]];
}
  • 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-24T06:35:43+00:00Added an answer on May 24, 2026 at 6:35 am

    A Hilbert curve would be a tall order. It seems difficult to find a formulation that would allow random access to the indices of the points on the curve.

    A Morton ordering, however, would be reasonable, and has some of the same nice properties as it is also a space-filling curve. There is also a random access procedure for finding the Morton number of an N-dimensional point.

    What you might consider is a two step process:

    1. Apply a step of stream compaction to your data to select the volume elements that you wish to process

    2. Sort this compacted data, using their Morton indices as the sorting key.

    You could use thrust for both the stream compaction and the key-value sort.

    This should produce a list of volume elements in a ordering which promotes contiguity. That said, the overhead of reorganizing the data may dominate the cost of the original irregular access pattern.

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

Sidebar

Related Questions

Here is my issue. I have an array containing the name of cities that
I have an array of 1000 strings to load into a combo box. What
I have an array containing all string values. Contents of the array are order_id,
I have got the array containing some data, say, a header and a real
I have an array containing multiple integers, is there a common way for sorting
I have an array containing a Variable amount of results/entries. I use foreach as
I have an array containing names of items. I want to give the user
hello I have a NSMutableArray iconlocarr . I also have another array containing dictionary
I'm using javascript, and I have an array containing multiple values, which may be
I have UITabBarController, containing 2 screens - A,B. I also have a strings array

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.