\documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage[polish]{babel} \usepackage{polski} \usepackage[utf8]{inputenc} \usepackage{indentfirst} \usepackage{geometry} \usepackage{array} \usepackage[pdftex]{color,graphicx} \usepackage{subfigure} \usepackage{afterpage} \usepackage{setspace} \usepackage{color} \usepackage{wrapfig} \usepackage{listings} \usepackage{datetime} \renewcommand{\onehalfspacing}{\setstretch{1.6}} \geometry{tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm} \setlength{\parindent}{1cm} \setlength{\parskip}{0mm} \newenvironment{lista}{ \begin{itemize} \setlength{\itemsep}{1pt} \setlength{\parskip}{0pt} \setlength{\parsep}{0pt} }{\end{itemize}} \newcommand{\linia}{\rule{\linewidth}{0.4mm}} \definecolor{lbcolor}{rgb}{0.95,0.95,0.95} \lstset{ backgroundcolor=\color{lbcolor}, tabsize=4, language=C++, captionpos=b, tabsize=3, frame=lines, numbers=left, numberstyle=\tiny, numbersep=5pt, breaklines=true, showstringspaces=false, basicstyle=\footnotesize, identifierstyle=\color{magenta}, keywordstyle=\color[rgb]{0,0,1}, commentstyle=\color{Darkgreen}, stringstyle=\color{red} } \begin{document} \noindent \begin{tabular}{|c|p{11cm}|c|} \hline Grupa 1 & Piotr Dergun, Dominik Waśko & \ddmmyyyydate\today \tabularnewline \hline \end{tabular} \section*{Zadanie 6 - Rozmycie Gaussa GPU} Celem zadania jest wykonanie rozmycia obrazu wykorzystując algorytm Gaussa za pomocą karty graficznej oraz technologii CUDA. Poniżej przedstawiono kod kernela, który oblicza rozmycie Gaussa. \begin{lstlisting} __global__ void gauss(int rows, int cols, unsigned char *in_r, unsigned char *in_g, unsigned char *in_b,unsigned char *out_r, unsigned char *out_g, unsigned char *out_b){ const int r=5; int ratio[r][r] ={ {1, 4, 7, 4, 1}, {4, 16, 26, 16, 4}, {7, 26, 41, 26, 7}, {4, 16, 26, 16, 4}, {1, 4, 7, 4, 1}}; int N,i,row,col,poz,temp,sum_r,sum_g,sum_b,offset; offset = 2; N = rows * cols; i = blockIdx.x * blockDim.x + threadIdx.x; while(irows-offset-1||colcols-offset-1)){ sum_r = 0; sum_g = 0; sum_b = 0; row-=offset; temp = col - offset; for (int j=0; j