Open main menu

CDOT Wiki β

Changes

GPU610 Team Tsubame

232 bytes added, 14:54, 12 April 2017
Attempt 1:
== PHASE 3 ==
* Optimize attempt=== Attempt 1 ===
We have tried to optimize the maze program. However, the result by removing some of optimization did not improve the speed of if statements to reduce thread divergence, however the program. In fact, it attempt made the program slower than the parallelization but phase 2 version and only a little bit faster than the serialversion.
Instead, we decided to use share memory in the GPU '''New Kernels:''' // Initialize all pixels to improve the speed of the program. However, the maze image does not showing correctly. * New Kernelblack (hex 000)
__global__ void k_drawWalls(png_byte* rows, const short* cells, const int width, const int height, const int len, const int size) {
int i = blockIdx.x * blockDim.x + threadIdx.x;
}
// Set pixels to white according to the pattern the cell belongs to
__global__ void k_drawPaths(png_byte* rows, const short* cells, const int width, const int height, const int len) {
int i = blockIdx.x * blockDim.x + threadIdx.x;
}
Because there were too many else if condition in the old Kernel, we rewrite the Kernel to avoid divergent.'''Analysis:'''
[[File:SPODiagram.PNG]]
*Sum up: **Still too many if statement For this attempt, the kernel executes for each cell instead of for each byte (in phase 2); it is no longer processing more than 1 pixel in each cell for every thread, which may be the Kernel**Almost cause to the same speed as the serial == Presentation == '''1longer processing time. Introduction'''
'''=== Attempt 2. Parallelize'''===
We decided to use shared memory in the GPU to improve the speed of the program. However, the maze image does not show correctly: the paths were showing as randomly coloured pixels; the cause is due to the threads setting only a part (1/3, 2/3) of a pixel'''3s values to hexadecimal F. Optimize'''
240
edits