// include system #include <stdio.h> // include CUDA #include <cuda_runtime.h> #include <helper_cuda.h> #define BLOCK_DIM 512 // use texture memory //-----------------------------------------------------// texture<unsigned char, 1 , cudaReadModeElementType>rT1;// texture<unsigned char, 1 , cudaReadModeElementType>rT2;// //-----------------------------------------------------// __global__ void Blending_Texture(unsigned char *aRS, int size){ int index = blockIdx.x * blockDim.x + threadIdx.x; if(index < size){ //-----------------------------------------------------------------------// aRS[index] = 0.5 * tex1Dfetch(rT1, index) + 0.5 * tex1Dfetch(rT2, index);// //-----------------------------------------------------------------------// } } void Blen_Device(unsigned char* aImg1, unsigned char* aImg2, unsigned char* aRS, int width, int height, int chanel){ int size = width * height * chanel
Comments
Post a Comment