aboutsummaryrefslogtreecommitdiff
path: root/matrix/cuda_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'matrix/cuda_helper.h')
-rw-r--r--matrix/cuda_helper.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/matrix/cuda_helper.h b/matrix/cuda_helper.h
index d6effdb..fde6f18 100644
--- a/matrix/cuda_helper.h
+++ b/matrix/cuda_helper.h
@@ -62,17 +62,14 @@ static const char *cublasGetErrorString(cublasStatus_t err) {
#define PROFILE_START \
do { \
- cudaEvent_t start, stop; \
- cudaEventCreate(&start); \
- cudaEventCreate(&stop); \
- cudaEventRecord(start, 0);
+ cudaEventRecord(profile_start, 0);
#define PROFILE_STOP \
- cudaEventRecord(stop, 0); \
- cudaEventSynchronize(stop); \
+ cudaEventRecord(profile_stop, 0); \
+ cudaEventSynchronize(profile_stop); \
float milliseconds = 0; \
- cudaEventElapsedTime(&milliseconds, start, stop); \
+ cudaEventElapsedTime(&milliseconds, profile_start, profile_stop); \
accu_profile(__func__, milliseconds / 1000); \
} while (0);
-#define PROFILE_END
+#define PROFILE_END
#endif