Skip to content

Commit d063343

Browse files
committed
add explicit prototypes
This is enough to allow the kernel to compile, though it still does not run correctly.
1 parent 3865526 commit d063343

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

samples/17_concurrentdispatch/main.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,22 @@ clGetKernelMaxConcurrentWorkGroupCountINTEL(
5656
#endif // !defined(cl_intel_concurrent_dispatch)
5757

5858
static const char kernelString[] = R"CLC(
59-
#pragma OPENCL EXTENSION cl_intel_concurrent_dispatch : enable
59+
//#pragma OPENCL EXTENSION cl_intel_concurrent_dispatch : enable
60+
bool __attribute__((overloadable)) intel_is_device_barrier_valid();
61+
void __attribute__((overloadable)) intel_device_barrier(
62+
cl_mem_fence_flags flags);
63+
void __attribute__((overloadable)) intel_device_barrier(
64+
cl_mem_fence_flags flags,
65+
memory_scope scope);
6066
kernel void DeviceBarrierTest( global uint* dst )
6167
{
6268
const size_t gws = get_global_size(0);
6369
atomic_add( &dst[gws], 1 );
6470
65-
//if (intel_is_device_barrier_valid()) {
66-
//intel_device_barrier( CLK_LOCAL_MEM_FENCE ); // TODO: check fence flags
67-
//intel_device_barrier( CLK_LOCAL_MEM_FENCE, memory_scope_device ); // TODO: check fence flags
68-
//}
71+
if (intel_is_device_barrier_valid()) {
72+
intel_device_barrier( CLK_GLOBAL_MEM_FENCE ); // TODO: check fence flags
73+
intel_device_barrier( CLK_GLOBAL_MEM_FENCE, memory_scope_device ); // TODO: check fence flags
74+
}
6975
7076
const uint id = get_global_id(0);
7177
dst[id] = dst[gws] + 1;

0 commit comments

Comments
 (0)