This file contains 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
int binary_search(int A[], int beg, int end, int target) | |
{ | |
int i = beg, j = end; | |
while (i < j) | |
{ | |
int mid = (i + j) / 2; | |
if (target < A[mid]) | |
j = mid; | |
else if (target > A[mid]) | |
i = mid + 1; |
This file contains 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
__kernel | |
void bitonicSort(__global uint * theArray, | |
const uint stage, | |
const uint passOfStage, | |
const uint direction) | |
{ | |
uint sortIncreasing = direction; | |
uint threadId = get_global_id(0); | |