1
edit
Changes
Team CNT
,no edit summary
=== Assignment 2 ===http://zenit.senecac.on.ca/wiki/index.php?title=Team_CNT&action=editI am not sure we are doing the Team work or individual. But since I did not here hear anything from my team mate I decided to go with my first assignment. I met many difficulties to adapt the existing c++ code to transfer some computations on GPU. In my first assignment I am doing different manipulations with the image. Image is a class. And this is one of the reason of delay with my second assignment. Apparently, I can't pass class to the Kernel. Kernel accepts only low types variable. So all the time I was truing different approaches how to parallelize my code. I even bought a new computer with CUDA compatible GPU card. And finally, when I found that method image.negate() would be easy to try to compute on Kernel, I've met some other difficulties. My code was done, I was happy. I decided to make 1000 negates of image to make sense of parallelyzing the code. I rewrote some code in my first assignment, remade the profile for first assignment (1000 negate operations). It took around 13 second on Linux. I profiled my code with Kernel computations on CUDA profiler, and.....it took around 60 seconds....So here is my new profile for assignment 1:
[[File:profile_new.png]]
the code for negate method is here:
<pre>
void Image::negateImage(Image& oldImage)
/*negates image*/
{
int rows, cols, gray;
rows = N;
cols = M;
gray = Q;
Image tempImage(N,M,Q);
for(int j=0; j<1000; j++){
for(int i = 0; i < rows; i++)
{
for(int j = 0; j < cols; j++)
tempImage.pixelVal[i][j] = -(pixelVal[i][j]) + 255;
tempImage.pixelVal[i][j] = -(pixelVal[i][j]) + 255;
tempImage.pixelVal[i][j] = -(pixelVal[i][j]) + 255;
}
}
oldImage = tempImage;
}
</pre>
=== Assignment 3 ===