cuda - Read data in a proper way -


I have a CPP file where I am creating an image and storing the data on my output pointer: / P>

  int rows = 80; Int Coles = 64; For (int i = 0; i & lt; rows; i ++) {for (int j = 0; j & lt; cols; j ++) {X = 1.0f * (float) i - (float ) Rows / 2) / (float) rows; Y = 2.0 F * (Float) j - (float) cols / 2) / (float) cells; ..... myOutput-> Ri = cough (......); MyOutput-> Im = sin (.......); ++ myOutput; }}   

Again, in Kuda I am reading: int bx = blockIdx.x, by = blockIdx.y; Int tx = threadIdx.x, ty = threadIdx.y; Int RowIdx = ty * * TILE_WIDTH; Int ColIdx = tx + bx * TILE_WIDTH; Index = roidx * coles + choledax; // Copy the input data for shared input memory [ty + 1] [tx + 1] = * (devInputArray + index);

(That's why, myOutput generated from CPP is loaded in devInputArray).

Now, I want to process several images at once.

, in CPP, the following should be made (for example 2 images):

  int ImagesNb = 2; For (Images ID = 0; Images IXx; Images; Images; Images Idx ++) {for (int i = 0; i   

But now I'm not sure how to read data from Kuda.

I do not know how to keep in mind the number of images.

Earlier, I had an indicator that had data (80 x 64).

Now, it still has the same dimension of every image but with more data.

I have to change it:

  index = rodex * coles + coled; // Copy the input data for shared input memory [ty + 1] [tx + 1] = * (devInputArray + index);  

I'm trying to do something like this:

  int bx = blockIdx.x, = blockIdx. Y, bz = blockIdx.z; Int tx = threadIdx.x, ty = threadIdx.y, tz = threadIdx.z; Int RowIdx = ty * * TILE_WIDTH; Int ColIdx = tx + bx * TILE_WIDTH; Int effects edx = tees + bez * blockdream; Index = Rueddx * Coles + Coleindex + Rows * Coles * Images   

and:

  Dim 3g Grid (images * * (call / TIDE / WIDTH) , ImageNB * (lines / TILE_WIDTH), images dim 3 dims (TILE_WIDTH, TILE_WIDTH, 2);   

But if I try 2 images then I'm not getting the right result. .

Okay, to use multiple pictures, you have to share the number of pictures. A. will add an extra dimension to the variables.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -