240
edits
Changes
→PHASE 2
PM> '''Install-Package libpng'''
6. In VS, Open MazePng.cpp, Replace replace the entire MazePng.cpp file with Paralleling code in the followingcode:
/*
* MazePng.cpp
// Call the kernel wrapper...
kw_drawWalls(row_pointers, this->cells, this->width, this->height, width, height, WALL, start);
fp = fopen("out.png", "wb");
}
7. In VS, right click on the project in the Solution explorer and Add -> '''New Item'''; Add a new '''Cuda c++ header''' file, name it '''"MazePng.cuh"'''
8. Cope Copy and paste the following code into '''"MazePng.cuh"''':
// MazePng.cuh
9. In VS, right click on the project in the Solution explorer and Add -> '''New Item'''; Add a new '''Cuda c++''' file, name it '''"MazePng.cu"'''
10. Cope Copy and paste the following code into '''"MazePng.cu"''':
// MazePng.cu
}
// Kernel wrapper...
void kw_drawWalls(png_bytep*& row_pointers, const short* cells, const int width, const int height, const int pixWidth, const int pixHeight, const png_byte WALL, const int start) {
int rowLen = pixWidth * 3;
k_drawWalls << <nblks, ntpb >> > (d_rows, d_cells, width, height, rowLen, szRows);
cudaStream_t* stream = new cudaStream_t[pixHeight];
12. In VS, go to menu Build -> Build Solution
== PHASE 3 ==