You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
synchronize_amdgpu(args::Union{Symbol,Expr}...) = :(ParallelStencil.ParallelKernel.synchronize_rocstream($(args...)))#TODO: this supports currently only stream synchronization. Whole GPU synchronization (all streams) should also be supported.
Copy file name to clipboardExpand all lines: src/ParallelKernel/shared.jl
+6-36Lines changed: 6 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -103,50 +103,20 @@ macro rangelengths() esc(:(($(RANGELENGTHS_VARNAMES...),))) end
103
103
end
104
104
105
105
@staticif ENABLE_AMDGPU
106
-
## Stream implementation for AMDGPU. It is the responsibility of the package developers to keep the ROCStreams consistent by pushing each signal received from a kernel launch on queue=stream.queue to the ROCStream using push_signal!. If ROCQueues are to be exposed to the users, then a macro should be implemented to automatize this (e.g. overwrite @roc to accept the kwarg stream...).
while (id >length(priority_rocstreams)) push!(priority_rocstreams, ROCStream(AMDGPU.default_device(); priority=:high)) end# :high is max priority.
112
+
while (id >length(priority_rocstreams)) push!(priority_rocstreams, AMDGPU.HIPStream(:high)) end
137
113
return priority_rocstreams[id]
138
114
end
139
115
140
-
#TODO: check if set priority to normal!
141
116
functionget_rocstream(id::Integer)
142
-
while (id >length(rocstreams)) push!(rocstreams, ROCStream(AMDGPU.default_device(); priority=:low)) end# :low min priority.
117
+
while (id >length(rocstreams)) push!(rocstreams, AMDGPU.HIPStream(:low)) end
143
118
return rocstreams[id]
144
119
end
145
-
146
-
functionget_default_rocstream()
147
-
if (length(default_rocstreams)==0) push!(default_rocstreams, ROCStream(AMDGPU.default_queue())) end# NOTE: this implementation is extensible to multiple defaults as available in CUDA for streams.
148
-
return default_rocstreams[1]
149
-
end
150
120
end
151
121
end
152
122
@@ -267,7 +237,7 @@ function split_parallel_args(args; is_call=true)
267
237
posargs, kwargs =split_args(args[1:end-1])
268
238
kernelarg = args[end]
269
239
if (is_call &&any([x.args[1] in [:blocks, :threads] for x in kwargs])) @KeywordArgumentError("Invalid keyword argument in @parallel <kernelcall>: blocks / threads. They must be passed as positional arguments or been omited.") end
270
-
if (is_call &&any([x.args[1] in [:groupsize, :gridsize, :queue] for x in kwargs])) @KeywordArgumentError("Invalid keyword argument in @parallel <kernelcall>: groupsize / gridsize / queue. CUDA nomenclature and concepts are to be used for @parallel calls (and kernels).") end
240
+
if (is_call &&any([x.args[1] in [:groupsize, :gridsize] for x in kwargs])) @KeywordArgumentError("Invalid keyword argument in @parallel <kernelcall>: groupsize / gridsize. CUDA nomenclature and concepts are to be used for @parallel calls (and kernels).") end
0 commit comments