diff --git a/src/parallelRadix.cu b/src/parallelRadix.cu index 0c839d1fafd424078af4633ccab8061e848e5c59..f4a81b27a983df450d26e680da8f1dfc7d153d21 100644 --- a/src/parallelRadix.cu +++ b/src/parallelRadix.cu @@ -8,6 +8,8 @@ using namespace std; +#define ARRSIZE 10000 + //fungsi cari isi array yg terbesar __global__ void getMax(unsigned int* array, int n) { const int tid = blockDim.x * blockIdx.x + threadIdx.x; @@ -41,7 +43,7 @@ __global__ void countOccurences(unsigned int * arr, int n, int * count, unsigned int main(int argc, char *argv[]) { curandGenerator_t curandGenerator; cudaEvent_t start, end; - const long count = 200000; + const long count = ARRSIZE; unsigned int dst[count]; unsigned int * src; int g, b; @@ -54,6 +56,9 @@ int main(int argc, char *argv[]) { curandSetPseudoRandomGeneratorSeed(curandGenerator, 13516042); cudaMalloc(&src, count * sizeof(unsigned int)); curandGenerate(curandGenerator, src, count); + + + cudaDeviceSynchronize(); cudaMemcpy(dst, src, count * sizeof(int), cudaMemcpyDeviceToHost);