Skip to content

Commit aa01346

Browse files
authored
ocl: removed experimental/outdated code (#913)
1 parent c3a6925 commit aa01346

File tree

3 files changed

+19
-40
lines changed

3 files changed

+19
-40
lines changed

src/acc/opencl/acc_opencl_event.c

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99
#if defined(__OPENCL)
1010
# include "acc_opencl.h"
1111

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-
2212

2313
# if defined(__cplusplus)
2414
extern "C" {
@@ -89,19 +79,10 @@ int c_dbcsr_acc_stream_wait_event(void* stream, void* event) { /* wait for an ev
8979
# if defined(CL_VERSION_1_2)
9080
cl_event clevent_result = NULL;
9181
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
10082
# else
10183
result = clEnqueueWaitForEvents(str->queue, 1, &clevent);
102-
if (EXIT_SUCCESS != result)
10384
# endif
104-
{
85+
if (EXIT_SUCCESS != result) {
10586
ACC_OPENCL_EXPECT(EXIT_SUCCESS == clReleaseEvent(clevent));
10687
*(cl_event*)event = NULL;
10788
}
@@ -129,26 +110,11 @@ int c_dbcsr_acc_event_record(void* event, void* stream) {
129110
str = (NULL != stream ? ACC_OPENCL_STREAM(stream) : c_dbcsr_acc_opencl_stream_default());
130111
assert(NULL != str && NULL != str->queue && NULL != event);
131112
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-
{
137113
# 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);
145115
# 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);
150117
# endif
151-
}
152118
if (NULL != clevent) {
153119
const int result_release = clReleaseEvent(clevent);
154120
if (EXIT_SUCCESS == result) result = result_release;

src/acc/opencl/acc_opencl_stream.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,20 @@ int c_dbcsr_acc_stream_sync(void* stream) {
261261
# endif
262262
str = (NULL != stream ? ACC_OPENCL_STREAM(stream) : c_dbcsr_acc_opencl_stream_default());
263263
assert(NULL != str && NULL != str->queue);
264-
result = clFinish(str->queue);
264+
if (0 == (16 & c_dbcsr_acc_opencl_config.wa)) result = clFinish(str->queue);
265+
else {
266+
cl_event event = NULL;
267+
# if defined(CL_VERSION_1_2)
268+
result = clEnqueueMarkerWithWaitList(str->queue, 0, NULL, &event);
269+
# else
270+
result = clEnqueueMarker(str->queue, &event);
271+
# endif
272+
if (EXIT_SUCCESS == result) {
273+
assert(NULL != event);
274+
result = clWaitForEvents(1, &event);
275+
}
276+
if (NULL != event) ACC_OPENCL_EXPECT(EXIT_SUCCESS == clReleaseEvent(event));
277+
}
265278
# if defined(__DBCSR_ACC) && defined(ACC_OPENCL_PROFILE_DBCSR)
266279
c_dbcsr_timestop(&routine_handle);
267280
# endif

src/acc/opencl/smm/opencl_libsmm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ int opencl_libsmm_acc_process(const int* host_param_stack, const int* dev_param_
11431143
(NULL == env_nz || '\0' == *env_nz) ? (0 != defaults ? /*default*/ 0 : config->nz) : atoi(env_nz), 0, 1);
11441144
new_config.al = LIBXSMM_CLMP(/* bug: AL=1 */
11451145
(NULL == env_al || '\0' == *env_al)
1146-
? (0 == (32 & c_dbcsr_acc_opencl_config.wa) ? (0 != defaults ? 0 : config->al) : 0)
1146+
? (0 == (64 & c_dbcsr_acc_opencl_config.wa) ? (0 != defaults ? /*default*/ 0 : config->al) : 0)
11471147
: atoi(env_al),
11481148
0, 1);
11491149
new_config.tb = LIBXSMM_CLMP(
@@ -1154,7 +1154,7 @@ int opencl_libsmm_acc_process(const int* host_param_stack, const int* dev_param_
11541154
(NULL == env_ap || '\0' == *env_ap) ? (0 != defaults ? /*default*/ 0 : config->ap) : atoi(env_ap), 0, 1);
11551155
new_config.aa = LIBXSMM_CLMP(/* bug: AA=2 XF=1 */
11561156
(NULL == env_aa || '\0' == *env_aa) ? (0 != defaults ? default_aa : config->aa) : atoi(env_aa), 0,
1157-
(0 == (16 & c_dbcsr_acc_opencl_config.wa) || 0 == new_config.flags) ? 2 : 1);
1157+
(0 == (32 & c_dbcsr_acc_opencl_config.wa) || 0 == new_config.flags) ? 2 : 1);
11581158
new_config.ab = LIBXSMM_CLMP(
11591159
(NULL == env_ab || '\0' == *env_ab) ? (0 != defaults ? default_ab : config->ab) : atoi(env_ab), 0, 2);
11601160
new_config.ac = LIBXSMM_CLMP(

0 commit comments

Comments
 (0)