From fb15aadfa1c0927401b6d9e8d70ae176e8541613 Mon Sep 17 00:00:00 2001 From: tung <13516135@std.stei.itb.ac.id> Date: Thu, 11 Apr 2019 22:55:28 +0700 Subject: [PATCH] add ARRSIZE --- src/parallelRadix.cu | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parallelRadix.cu b/src/parallelRadix.cu index 0c839d1..f4a81b2 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); -- GitLab