Array Of 2D-Textures

Hi!

does anyone know how create an array of 2D textures?

my intention is to do something like the following: (very pseudo)

texture<float, 2, cudaReadModeElementType> tex[4];

cudaChannelFormatDesc formatDescr;

cudaArray** projTexArray2D;

//initialize

init()

{

	formatDescr = cudaCreateChannelDesc<float>();

	projTexArray2D = new cudaArray*[4];

	for(int i=0; i<4; i++)

	{

		tet[i].addressMode[0] = cudaAddressModeClamp;

		tex[i].addressMode[1] = cudaAddressModeClamp;

		tex[i].filterMode = cudaFilterModeLinear;

		tex[i].normalized = false;

		cudaMallocArray(&projTexArray2D[i], &formatDescr, width, height);

		cudaBindTextureToArray(tex[i], projTexArray2D[i]);

	}

}

//fill arrays with some data

fill(float** someData)

{

	for(int i=0; i<4, i++)

	{

		cudaMemcpyToArray(projTexArray2D[i], 0, 0, someData[i], width*height*sizeof(float), cudaMemcpyHostToDevice);

	}

}

//read from texture within kernel

__device__ myKernel()

{

	for(int i=0; i<4; i++)

	{

		float c = tex2D(tex[i], x, y)  //for some reason the compiler doesn't know 'tex' anymore: 

														 //"error: identifier "tex" is undefined"

	}

}

… maybe someone else had the same intention / issue?!

thanks and regards, rob

deleted post: sorry i didn’t unsterstand your question