正在加载图片...
SOURCE CODE OF A PICTUREKERNEL global void PictureKernel(float*d Pin,float*d Pout, int height,int width) { /Calculate the row of the d pin and d Pout element int Row blockIdx.y*blockDim.y threadIdx.y; /Calculate the column of the d pin and d Pout element int Col blockIdx.x*blockDim.x threadIdx.x; /each thread computes one element of d Pout if in range if ((Row height)&&(Col width)){ d Pout [Row*width+Col]2.0*d Pin[Row*width+Col]; 电子料发女学 University of Electreaie Science and Technolory of China OSOURCE CODE OF A PICTUREKERNEL __global__ void PictureKernel(float* d_Pin, float* d_Pout, int height, int width) { // Calculate the row # of the d_Pin and d_Pout element int Row = blockIdx.y*blockDim.y + threadIdx.y; // Calculate the column # of the d_Pin and d_Pout element int Col = blockIdx.x*blockDim.x + threadIdx.x; // each thread computes one element of d_Pout if in range if ((Row < height) && (Col < width)) { d_Pout[Row*width+Col] = 2.0*d_Pin[Row*width+Col]; } } Scale every pixel value by 2.0
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有