Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 96b9ac5

Browse files
committed
add isdevice to check if function is executed on device
1 parent 2d7e5b1 commit 96b9ac5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/CUDAnative.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ end
2323
include("utils.jl")
2424

2525
# needs to be loaded _before_ the compiler infrastructure, because of generated functions
26+
isdevice() = false
2627
include(joinpath("device", "tools.jl"))
2728
include(joinpath("device", "pointer.jl"))
2829
include(joinpath("device", "array.jl"))

src/context.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ using Cassette
1818
Cassette.@context CUDACtx
1919
const cudactx = CUDACtx()
2020

21+
function Cassette.overdub(ctx::CUDACtx, ::typeof(isdevice))
22+
return true
23+
end
24+
2125
# libdevice.jl
2226
for f in (:cos, :cospi, :sin, :sinpi, :tan,
2327
:acos, :asin, :atan,

0 commit comments

Comments
 (0)