Course Solutions Uncategorized (Solved) : Global Void Sobelgpushared Float Image Int Height Int Width Float Xmatrix Float Ymatrix Fl Q29663237 . . . .

(Solved) : Global Void Sobelgpushared Float Image Int Height Int Width Float Xmatrix Float Ymatrix Fl Q29663237 . . . .

 

__global__

void SobelGPUShared(float *image, int height, int width, float*x_matrix,

float *y_matrix, float *output) {

extern __shared__ float arr[];

int i = blockIdx.x*blockDim.x+threadIdx.x;

int j = blockIdx.y*blockDim.y+threadIdx.y;

//arr[i*j] = image[i*j];

if(i < height && j < width)

{

float x_grad=0;

x_grad += x_matrix[0 * MATRIX_DIM + 0] *

GetValidPixelValue(image, height, width, i – 1, j – 1);

x_grad += x_matrix[0 * MATRIX_DIM + 2] *

GetValidPixelValue(image, height, width, i – 1, j + 1);

x_grad += x_matrix[1 * MATRIX_DIM + 0] *

GetValidPixelValue(image, height, width, i, j – 1);

x_grad += x_matrix[1 * MATRIX_DIM + 2] *

GetValidPixelValue(image, height, width, i, j + 1);

x_grad += x_matrix[2 * MATRIX_DIM + 0] *

GetValidPixelValue(image, height, width, i + 1, j –

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post