diff options
Diffstat (limited to 'main.cu')
| -rw-r--r-- | main.cu | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -309,7 +309,7 @@ public: __device__ void increaseRoundCount(unsigned count = 1) { atomicAdd(&this->round, count); } - int spend_time[NUM_ITEMS]; + int spend_time[NUM_ITEMS]{0}; unsigned long long total_time = 0; __device__ unsigned getRoundCount() const { return this->round; } #endif @@ -578,7 +578,7 @@ __global__ void kernel(LL *items, LL *op, LL *result) { #ifdef MEASURE_TIME unsigned long long end_time = clock64() - start_time; if (l->spend_time[tid]) { - printf("%d\n", tid); + printf("conflict: %d\n", tid); } l->spend_time[tid] = (int)end_time; #endif @@ -645,7 +645,7 @@ __global__ void print_function() { } __global__ void copy_function(int *spend_time) { - memcpy(spend_time, l->spend_time, sizeof(int) * NUM_THREADS); + memcpy(spend_time, l->spend_time, sizeof(int) * NUM_ITEMS); } int main(int argc, char **argv) { |
