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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:39:56+00:00 2026-06-10T04:39:56+00:00

I have some data to be processed, with each block being responsible for a

  • 0

I have some data to be processed, with each block being responsible for a given subset of the data.

Due to the nature of my application, I want this data to reside in texture memory. However, the data is too big to fit in one single texture reference.

If I understood correctly, I can have multiple texture references, but not an array of texture references.

As I need to process a different subset of the data in each block, I was thinking of doing something (in the kernel) like

while(counter < 10000) {

 if(blockIdx.x == 0)
     foo = tex2D(tex0, x, y);

 else if(blockIdx.x == 1)
     foo = tex2D(tex1, x, y);

 ...

}

But not only is this bad to look at, I’m also not sure if I won’t incur in divergence problems.

Doing something like

texture<int, 2, cudaReadModeElementType> ref;

(..)

/* kernel code from now on */

if(blockIdx.x == 0)
    ref = tex0;

else if(blockIdx.x == 1)
    ref = tex1;

...

while(counter < 10000)
    foo = tex2D(ref, x, y)

also doesn’t quite seem right, as I believe texture references are global and not private to threads.

Is there any other alternative? 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-10T04:39:58+00:00Added an answer on June 10, 2026 at 4:39 am

    If possible, you should try to keep your texture data in a single texture, and apply some transformation to the coordinates as needed to fit within the hardware limitations.

    Otherwise, you can select from multiple texture references via predication. Only the non-predicated instruction will actually generate a texture memory reference.

    The tex1dfetch_big.cu sample from The CUDA Handbook shows how to do this, to increase addressing beyond the 27-bit indices supported by the hardware.

    https://github.com/ArchaeaSoftware/cudahandbook/blob/checkpoint/texturing/tex1dfetch_big.cu

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

Sidebar

Related Questions

I have some data generated in MATLAB that I want to process using Perl.
I have console application. In that i have some process that fetch the data
I have some data and need to create a json file with this structure
Suppose I have a class that processes some data: class SomeClass { public: void
I have a data-upload function that load some data into several tables and processes
I have some data loaded as a np.ndarray and need to convert it to
I have some data from log files and would like to group entries by
I have some data files in the resources/ folder for my Rubymotion project. How
I have some data which (quite reasonably) uses null and false for different meanings.
I have some data that is stored in a TIMESTAMP(6) WITH TIMEZONE column in

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.