Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query function for if we are executing on a GPU #422

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KernelAbstractions"
uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
authors = ["Valentin Churavy <v.churavy@gmail.com> and contributors"]
version = "0.9.8"
version = "0.10.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
8 changes: 8 additions & 0 deletions src/KernelAbstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,14 @@ function priority!(::Backend, prio::Symbol)
return nothing
end


"""
ongpu()

Returns if this kernel is currently executing on a GPU.
"""
function ongpu end
vchuravy marked this conversation as resolved.
Show resolved Hide resolved

include("nditeration.jl")
using .NDIteration
import .NDIteration: get
Expand Down
2 changes: 2 additions & 0 deletions src/cpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ end
end
end

ongpu() = false

###
# CPU implementation of shared memory
###
Expand Down