can I use texture to calculate Poisson's equation for scientific computing?

The double is needed for scientific computing in charged particle beam dynamics, can I use texture to calculate Poisson’s equation by using the segment as follows?

texture<int2,1> my_texture;

static inline device double fetch_double(texture<int2, 1> t, int i)
{
int2 v = tex1Dfetch(t,i);
return __hiloint2double(v.y, v.x);
}


CUDA C Programming Guide >> Programming Interface >> P43:

The type of a texel, which is restricted to the basic integer and single-precision
floating-point types and any of the 1-, 2-, and 4-component vector types defined in
char, short, int, long, longlong, float, double that are derived from the basic integer
and single-precision floating-point types.


https://cudazone.nvidia.cn/cuda-faq/ :

Q: Can I fetch double from texture?
A: The hard device cannot support it. But one can use double by deriving from int2 if there is no interpolation:
texture<int2,1> my_texture;

static inline device double fetch_double(texture<int2, 1> t, int i)
{
int2 v = tex1Dfetch(t,i);
return __hiloint2double(v.y, v.x);
}

///////////////
Appendix:

问: 我能否从纹理中读取双精度浮点?
硬件不支持将双精度浮点视为一种纹理格式,但是只要不需要插值 (Interpolation),便能够使用 int2 并将其配置为双精度:

texture<int2,1> my_texture;

static inline device double fetch_double(texture<int2, 1> t, int i)
{
int2 v = tex1Dfetch(t,i);
return __hiloint2double(v.y, v.x);
}

Did you try it?

Haven’t yet.