Skip to content

Commit 668b3cf

Browse files
committed
Implement remaining intrinsics for POCL
1 parent b9bc629 commit 668b3cf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/pocl/backend.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ end
154154
return (; x = get_global_id(1), y = get_global_id(2), z = get_global_id(3))
155155
end
156156

157+
@device_override @inline function KI.get_local_size()
158+
return (; x = get_local_size(1), y = get_local_size(2), z = get_local_size(3))
159+
end
160+
161+
@device_override @inline function KI.get_num_groups()
162+
return (; x = get_num_groups(1), y = get_num_groups(2), z = get_num_groups(3))
163+
end
164+
165+
@device_override @inline function KI.get_global_size()
166+
return (; x = get_global_size(1), y = get_global_size(2), z = get_global_size(3))
167+
end
168+
157169
@device_override @inline function KA.__validindex(ctx)
158170
if KA.__dynamic_checkbounds(ctx)
159171
I = @inbounds KA.expand(KA.__iterspace(ctx), get_group_id(1), get_local_id(1))
@@ -178,7 +190,7 @@ end
178190

179191
## Synchronization and Printing
180192

181-
@device_override @inline function KA.__synchronize()
193+
@device_override @inline function KI.barrier()
182194
SPIRVIntrinsics.barrier(SPIRVIntrinsics.CLK_LOCAL_MEM_FENCE | SPIRVIntrinsics.CLK_GLOBAL_MEM_FENCE)
183195
end
184196

0 commit comments

Comments
 (0)