This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| # Print iterations progress | |
| def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100): | |
| """ | |
| Call in a loop to create terminal progress bar | |
| @params: | |
| iteration - Required : current iteration (Int) | |
| total - Required : total iterations (Int) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Block queuing stub | |
| __global__ void gpu_block_queuing_kernel( | |
| int *nodePtrs, int *nodeNeighbors, int *nodeVisited, | |
| int *currLevelNodes, int *nextLevelNodes, | |
| const unsigned int numCurrLevelNodes, int *numNextLevelNodes) { | |
| //@@ INSERT Block Queuing code here | |
| // Initialize shared memory queue | |
| __shared__ int block_queue[BQ_CAPACITY]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __global__ void s2g_sm_gpu_gather_kernel(int *in, int *out, int len) { | |
| //@@ INSERT CODE HERE | |
| __shared__ int values[TILE_SIZE]; | |
| // Get our global thread ID | |
| int id = blockIdx.x*blockDim.x + threadIdx.x; | |
| int sum = 0; | |