Skip to content
Snippets Groups Projects
Commit a3a5d40b authored by Restu Wahyu Kartiko's avatar Restu Wahyu Kartiko
Browse files

Add print array

parent 06feac53
No related merge requests found
...@@ -16,6 +16,15 @@ void rng(uint64_t *arr, int n) ...@@ -16,6 +16,15 @@ void rng(uint64_t *arr, int n)
} }
} }
void print_arr(uint32_t* arr, int n)
{
for (int i = 0; i < n; i++) {
printf("%d ", arr[i]);
}
printf("\n");
}
__global__ __global__
void flag_array(uint64_t *arr, int n, int *flag, int idx) { void flag_array(uint64_t *arr, int n, int *flag, int idx) {
int index = blockIdx.x * blockDim.x + threadIdx.x; int index = blockIdx.x * blockDim.x + threadIdx.x;
...@@ -201,6 +210,8 @@ int main(int argc, char **argv) ...@@ -201,6 +210,8 @@ int main(int argc, char **argv)
} }
fprintf(stderr, "time: %lld us\n", microsecs); fprintf(stderr, "time: %lld us\n", microsecs);
print_arr(arr, N);
free(arr); free(arr);
return 0; return 0;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment