# Is it correct for mono image process

**URL:** <https://forums.developer.nvidia.com/t/is-it-correct-for-mono-image-process/7358>\
**Category:** CUDA Programming and Performance\
**Created:** [January 22, 2009, 1:58am UTC](https://forums.developer.nvidia.com/t/is-it-correct-for-mono-image-process/7358 "2009-01-22T01:58:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darot](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@darot](https://forums.developer.nvidia.com/u/darot)\
**Post date:** [January 22, 2009, 1:58am UTC](https://forums.developer.nvidia.com/t/is-it-correct-for-mono-image-process/7358/1 "2009-01-22T01:58:14Z")

</div>

Dear all:

After my testing, even make all L/UL of global mem are coalesced memoy access when using share memoy ,

The transfer time is still there.(becasue I have to do syncthread after read like code below).

```auto
__shared__ float share[BLOCK_SIZESglLRX][BLOCK_SIZESglLRY];

	unsigned int xIndex,yIndex,index_in;

	xIndex = blockIdx.x * BLOCK_SIZESglLRX + threadIdx.x;-blockIdx.x*Pitch;

	yIndex = blockIdx.y * BLOCK_SIZESglLRY + threadIdx.y;

	index_in = yIndex * devImgSizeX + xIndex;

	if (xIndex<devImgSizeX && yIndex<devImgSizeY){

		share[threadIdx.x][threadIdx.y] = *(S+index_in);

	}

	__syncthreads();

```

If I want to make a 2d convolution process(not seperable), like smooth or laplacian, I think to use texture memory will be faster then use share memoy.

Is it right?

---

<div class="post-metadata">

**Author:** ![tatou1234](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tatou1234](https://forums.developer.nvidia.com/u/tatou1234)\
**Post date:** [January 22, 2009, 7:46am UTC](https://forums.developer.nvidia.com/t/is-it-correct-for-mono-image-process/7358/2 "2009-01-22T07:46:33Z")

</div>

> [@](#):
>
> Dear all:
> 
> After my testing, even make all L/UL of global mem are coalesced memoy access when using share memoy ,
> 
> The transfer time is still there.(becasue I have to do syncthread after read like code below).
> 
> ```auto
> __shared__ float share[BLOCK_SIZESglLRX][BLOCK_SIZESglLRY];
> 
> unsigned int xIndex,yIndex,index_in;
> 
> xIndex = blockIdx.x * BLOCK_SIZESglLRX + threadIdx.x;-blockIdx.x*Pitch;
> 
> yIndex = blockIdx.y * BLOCK_SIZESglLRY + threadIdx.y;
> 
> index_in = yIndex * devImgSizeX + xIndex;
> 
> if (xIndex<devImgSizeX && yIndex<devImgSizeY){
> 
> share[threadIdx.x][threadIdx.y] = *(S+index_in);
> 
> }
> 
> __syncthreads();
> 
> ```
> 
> If I want to make a 2d convolution process(not seperable), like smooth or laplacian, I think to use texture memory will be faster then use share memoy.
> 
> Is it right?

I’m not sure if is faster but I know that shared memory is very very fast. Are you interested on computer vision? Do you know where I can find information about it and cuda??

---

<div class="post-metadata">

**Author:** ![MisterAnderson42](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MisterAnderson42](https://forums.developer.nvidia.com/u/MisterAnderson42)\
**Post date:** [January 22, 2009, 12:35pm UTC](https://forums.developer.nvidia.com/t/is-it-correct-for-mono-image-process/7358/3 "2009-01-22T12:35:03Z")

</div>

> [@](#):
>
> If I want to make a 2d convolution process(not seperable), like smooth or laplacian, I think to use texture memory will be faster then use share memoy.
> 
> Is it right?

Try it and find out!
