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

  • Home
  • SEARCH
  • 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 8039109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:27:52+00:00 2026-06-05T03:27:52+00:00

This isn’t necessarily CUDA specific. Basically, on the GPU I have a 1D array,

  • 0

This isn’t necessarily CUDA specific.

Basically, on the GPU I have a 1D array, but in the C code, I have a 3d array. I need to copy this array back and forth, and I need to be able to linear-ize the indices properly. That means that I have the pick the correct numbering scheme, as in is (1, 0, 0) linear-ized as 1, or is (0, 1, 0), or (0, 0, 1), in the form (x, y, z)?

The 3d arrays are declared as array[X][Y][Z]. When I copy that 3D array into an equal sized 1d array, how will the computer naturally number it? However the computer collapses down the 3d array, I need to do the exact same when I try to convert between the two. I hope I am making clear what I want to say, but if you have any questions, please ask. 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-06-05T03:27:54+00:00Added an answer on June 5, 2026 at 3:27 am

    Arrays in C are kept in row-major order, see this for more details.

    So the first element is array[0][0][0], the second is array[0][0][1], and etc.

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

Sidebar

Related Questions

This isn't a code question for once, but it definitely has me confused. Basically,
This isn't about a specific problem I'm having, but I have to clear something
This isn't really related to a specific error; my code is not doing what
This isn't necessarily a programming question, but I've hit a performance bottleneck with disk
This isn't the complete code, but it's the parts that are causing problems. I've
This isn’t a specific question with a specific solution; but it’s rather a response
This isn't necessarily a programming question but i'm sure you folks know how to
This isn't the best question ever, but since search engines feel the need to
This isn't strictly a programming question, but I'm asking it here because it's certainly
This isn't cross-platform code... everything is being performed on the same platform (i.e. endianess

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.