Skip to content

Commit

Permalink
JLArray is now registered (#103)
Browse files Browse the repository at this point in the history
* Update adapt.jl

* Update Project.toml

* format

* delete repeated code
  • Loading branch information
YichengDWu authored Jul 23, 2022
1 parent f1cdffc commit 5f4333e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand Down
15 changes: 6 additions & 9 deletions test/adapt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ if CUDA.functional()
using CUDA # exports CuArray, etc
@info "starting CUDA tests"
else
@info "CUDA not functional, testing via GPUArrays"
using GPUArrays
GPUArrays.allowscalar(false)

# GPUArrays provides a fake GPU array, for testing
jl_file = normpath(joinpath(pathof(GPUArrays), "..", "..", "test", "jlarray.jl"))
using Random, Adapt # loaded within jl_file
include(jl_file)
using .JLArrays
@info "CUDA not functional, testing via JLArrays"
using JLArrays
JLArrays.allowscalar(false)

# JLArrays provides a fake GPU array, for testing
using Random, Adapt
CUDA.cu(x) = jl(x)
CuArray{T, N} = JLArray{T, N}

Expand Down

0 comments on commit 5f4333e

Please sign in to comment.