# double texture memory

**URL:** <https://forums.developer.nvidia.com/t/double-texture-memory/6135>\
**Category:** CUDA Programming and Performance\
**Created:** [October 29, 2008, 4:58pm UTC](https://forums.developer.nvidia.com/t/double-texture-memory/6135 "2008-10-29T16:58:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanyh](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@yanyh](https://forums.developer.nvidia.com/u/yanyh)\
**Post date:** [October 29, 2008, 4:58pm UTC](https://forums.developer.nvidia.com/t/double-texture-memory/6135/1 "2008-10-29T16:58:03Z")

</div>

I tried to use double texture reference for a double memory in my GPU (GTX 280 with DP), but looks like texture does not support double. any reason and work around for this.

thanks very much!  
YH

---

<div class="post-metadata">

**Author:** ![Simon\_Green](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Simon\_Green](https://forums.developer.nvidia.com/u/Simon_Green)\
**Post date:** [October 29, 2008, 7:20pm UTC](https://forums.developer.nvidia.com/t/double-texture-memory/6135/2 "2008-10-29T19:20:39Z")

</div>

The hardware doesn’t support double precision float as a texture format, but it is possible to use int2 and cast it to double as long as you don’t need interpolation:

```auto
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);

}

```

---

<div class="post-metadata">

**Author:** ![yanyh](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@yanyh](https://forums.developer.nvidia.com/u/yanyh)\
**Post date:** [November 3, 2008, 5:48pm UTC](https://forums.developer.nvidia.com/t/double-texture-memory/6135/3 "2008-11-03T17:48:49Z")

</div>

> [@](#):
>
> The hardware doesn’t support double precision float as a texture format, but it is possible to use int2 and cast it to double as long as you don’t need interpolation:
> 
> ```auto
> 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);
> 
> }
> 
> ```

that is good. late thanks
