@@ -57,7 +57,14 @@ KA.functional(::POCLBackend) = true
5757KA. pagelock! (:: POCLBackend , x) = nothing
5858
5959KA. get_backend (:: Array ) = POCLBackend ()
60- KA. synchronize (:: POCLBackend ) = cl. finish (cl. queue ())
60+
61+ # # Implementation note:
62+ # # The POCL backend uses `Base.Array` as it's array type, so the external operations
63+ # # `broadcast`, `*` and other high-level operations are handled by Julia. In order
64+ # # to provide the same memory synchronization semantics as other backends, we
65+ # # must synchronize upon kernel launch and can't rely on synchronization upon
66+ # # array access. Therefore, `synchronize` is a no-op.
67+ KA. synchronize (:: POCLBackend ) = nothing
6168KA. supports_float64 (:: POCLBackend ) = true
6269KA. supports_unified (:: POCLBackend ) = true
6370
149156function (obj:: KI.Kernel{POCLBackend} )(args... ; numworkgroups = 1 , workgroupsize = 1 )
150157 KI. check_launch_args (numworkgroups, workgroupsize)
151158
152- local_size = (workgroupsize... , ntuple (_-> 1 , 3 - length (workgroupsize))... , )
159+ local_size = (workgroupsize... , ntuple (_ -> 1 , 3 - length (workgroupsize))... )
153160
154- numworkgroups = (numworkgroups... , ntuple (_-> 1 , 3 - length (numworkgroups))... , )
161+ numworkgroups = (numworkgroups... , ntuple (_ -> 1 , 3 - length (numworkgroups))... )
155162 global_size = local_size .* numworkgroups
156163
157164 event = obj. kern (args... ; local_size, global_size)
0 commit comments