summaryrefslogtreecommitdiff
path: root/main.cu
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2022-06-21 07:55:51 +0800
committerKunoiSayami <[email protected]>2022-06-21 07:55:51 +0800
commit985dfaf9f1b541b51e020561ccc9b91d9c982510 (patch)
tree2a70518d24b9754d7e6fb086ee81dd00baaacbe7 /main.cu
parent85296957a8d755cda80c5dc00dcef4555ff14ebc (diff)
feat(script): Optimize normal distribution generator
* feat(script): Finish experiment 1 and 2 Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'main.cu')
-rw-r--r--main.cu7
1 files changed, 2 insertions, 5 deletions
diff --git a/main.cu b/main.cu
index bc42b11..c34add0 100644
--- a/main.cu
+++ b/main.cu
@@ -92,7 +92,6 @@ typedef unsigned int LL;
#endif
#ifdef MEASURE_TIME
-#include <cuda/atomic>
#undef BUILD_SIZE
#define BUILD_SIZE 1024
#endif
@@ -578,12 +577,10 @@ __global__ void kernel(LL *items, LL *op, LL *result) {
result[tid] = l->Search(item);
#ifdef MEASURE_TIME
unsigned long long end_time = clock64() - start_time;
- // SpendTime[tid] = (int)end_time;
if (l->spend_time[tid]) {
printf("%d\n", tid);
}
l->spend_time[tid] = (int)end_time;
- // printf("%d %d\n", SpendTime[tid], tid);
#endif
}
}
@@ -833,7 +830,7 @@ int main(int argc, char **argv) {
cudaEventCreate(&stop);
cudaEventRecord(start, nullptr);
#ifdef MEASURE_TIME
- kernel<<<NUM_THREADS, 1>>>(Citems, Cop2, Cresult);
+ kernel<<<NUM_ITEMS, 1>>>(Citems, Cop2, Cresult);
#else
kernel<<<blocks, NUM_THREADS>>>(Citems, Cop2, Cresult);
#endif
@@ -891,7 +888,7 @@ int main(int argc, char **argv) {
break;
fprintf(file, "%d\n", tmp[i]);
}
- // printf("%d\n", i);
+ printf("%d\n", i);
delete[] tmp;
fclose(file);
}