texture memory && cudaMallocArray(...)

I implemented matrix adddition and matrix multiplication with texture memroy.

But ,I found an error when the matrices increased.

For matrixAdd:

A: 48 * 80 B:48*80 C=A+B

Set the matrices like above ,the GPU’s and CPU’s results are same and right by attachment rightResult.

The kernel run on GPU is computed by function tex1D.

But, I increase the matrices size:

A:160160 B:160160

The GPU’s results showed by attachment wrongResult is wrong, and indicate:

CUDA_SAFE_CALL(cudaMallocArray(&cuArray1,&desc,WA,HA)):invalid argument

And the matrixMul program has the same problem.

I don’t know the reason. Is it possible that texture memory is limited,and the texture size cann’t be as large as you want to be?

Best regards.

[attachment=6846:attachment]

[attachment=6847:attachment]
wrongResult.bmp (474 KB)
(upload://w3AseewuEjJ5h0As1BUAuaCdWam.bmp) (442 KB)

Cuda array of size 160x160 can be allocated without any trouble. The problem should be some kind of bug in you code.

Texture memory size is limited.

From Programming guide2.0beat2 (Section A.1.1)