|
9 | 9 | #if defined(__OPENCL) |
10 | 10 | # include "acc_opencl.h" |
11 | 11 |
|
12 | | -# if !defined(ACC_OPENCL_EVENT_FLUSH) && 0 |
13 | | -# define ACC_OPENCL_EVENT_FLUSH |
14 | | -# endif |
15 | | -# if !defined(ACC_OPENCL_EVENT_CHAIN) && 0 |
16 | | -# define ACC_OPENCL_EVENT_CHAIN |
17 | | -# endif |
18 | | -# if !defined(ACC_OPENCL_EVENT_WAIT) && 0 |
19 | | -# define ACC_OPENCL_EVENT_WAIT |
20 | | -# endif |
21 | | - |
22 | 12 |
|
23 | 13 | # if defined(__cplusplus) |
24 | 14 | extern "C" { |
@@ -89,19 +79,10 @@ int c_dbcsr_acc_stream_wait_event(void* stream, void* event) { /* wait for an ev |
89 | 79 | # if defined(CL_VERSION_1_2) |
90 | 80 | cl_event clevent_result = NULL; |
91 | 81 | result = clEnqueueBarrierWithWaitList(str->queue, 1, &clevent, &clevent_result); |
92 | | - if (EXIT_SUCCESS == result) { |
93 | | -# if defined(ACC_OPENCL_EVENT_CHAIN) |
94 | | - result = clReleaseEvent(clevent); |
95 | | - assert(NULL != clevent_result); |
96 | | - *(cl_event*)event = (EXIT_SUCCESS == result ? clevent_result : NULL); |
97 | | -# endif |
98 | | - } |
99 | | - else |
100 | 82 | # else |
101 | 83 | result = clEnqueueWaitForEvents(str->queue, 1, &clevent); |
102 | | - if (EXIT_SUCCESS != result) |
103 | 84 | # endif |
104 | | - { |
| 85 | + if (EXIT_SUCCESS != result) { |
105 | 86 | ACC_OPENCL_EXPECT(EXIT_SUCCESS == clReleaseEvent(clevent)); |
106 | 87 | *(cl_event*)event = NULL; |
107 | 88 | } |
@@ -129,26 +110,11 @@ int c_dbcsr_acc_event_record(void* event, void* stream) { |
129 | 110 | str = (NULL != stream ? ACC_OPENCL_STREAM(stream) : c_dbcsr_acc_opencl_stream_default()); |
130 | 111 | assert(NULL != str && NULL != str->queue && NULL != event); |
131 | 112 | clevent = *ACC_OPENCL_EVENT(event); |
132 | | -# if defined(ACC_OPENCL_EVENT_FLUSH) |
133 | | - result = clFlush(str->queue); |
134 | | - if (EXIT_SUCCESS == result) |
135 | | -# endif |
136 | | - { |
137 | 113 | # if defined(CL_VERSION_1_2) |
138 | | -# if defined(ACC_OPENCL_EVENT_WAIT) |
139 | | - if (NULL != clevent) result = clEnqueueMarkerWithWaitList(str->queue, 1, &clevent, &clevent_result); |
140 | | - else |
141 | | -# endif |
142 | | - { |
143 | | - result = clEnqueueMarkerWithWaitList(str->queue, 0, NULL, &clevent_result); |
144 | | - } |
| 114 | + result = clEnqueueMarkerWithWaitList(str->queue, 0, NULL, &clevent_result); |
145 | 115 | # else |
146 | | -# if defined(ACC_OPENCL_EVENT_WAIT) |
147 | | - if (NULL != clevent) result = clEnqueueWaitForEvents(str->queue, 1, &clevent); |
148 | | -# endif |
149 | | - if (EXIT_SUCCESS == result) result = clEnqueueMarker(str->queue, &clevent_result); |
| 116 | + result = clEnqueueMarker(str->queue, &clevent_result); |
150 | 117 | # endif |
151 | | - } |
152 | 118 | if (NULL != clevent) { |
153 | 119 | const int result_release = clReleaseEvent(clevent); |
154 | 120 | if (EXIT_SUCCESS == result) result = result_release; |
|
0 commit comments