Skip to content

Commit

Permalink
overload NNlib._rng_compat_array (#62)
Browse files Browse the repository at this point in the history
* overload NNlib._rng_compat_array

* trigger CI
  • Loading branch information
mcabbott authored Jan 7, 2023
1 parent 797f567 commit 2e29186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "NNlibCUDA"
uuid = "a00861dc-f156-4864-bf3c-e6376f28a68d"
version = "0.2.5"
version = "0.2.6"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -13,7 +13,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
Adapt = "3.3"
CUDA = "3.11"
NNlib = "0.8.14"
NNlib = "0.8.15"
julia = "1.6"

[extras]
Expand Down
4 changes: 4 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
NNlib._rng_from_array(::CuArray) = CUDA.default_rng()

NNlib._rng_compat_array(rng::CUDA.RNG, A::CuArray) = nothing
NNlib._rng_compat_array(rng::AbstractRNG, A::CuArray) = throw(ArgumentError(
"cannot use rng::$(typeof(rng)) with array::CuArray, only CUDA's own RNG type works"))

function divide_kernel!(xs, ys, max_idx)
index = threadIdx().x + (blockIdx().x - 1) * blockDim().x

Expand Down

2 comments on commit 2e29186

@mcabbott
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/75304

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.6 -m "<description of version>" 2e291867f2f05830f2a57e7536e95703ad9fffcc
git push origin v0.2.6

Please sign in to comment.