Skip to content

Commit

Permalink
add additional @batch test
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Apr 2, 2021
1 parent d44611b commit 0aef43a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ function bsin!(y,x)
y[i] = sin(x[i])
end
end
function sin_batch_sum(v)
s = zeros(8,Threads.nthreads())
@batch for i = 1:length(v)
s[1,Threads.threadid()] += sin(v[i])
end
return sum(view(s, 1, :))
end

@testset "Range Map" begin
function rangemap!(f::F, allargs, start, stop) where {F}
Expand Down Expand Up @@ -60,6 +67,7 @@ end
x = randn(100_000); y = similar(x);
bsin!(y, x)
@test y == sin.(x)
@test sum(sin,x) sin_batch_sum(x)
end

@testset "start and stop values" begin
Expand Down

2 comments on commit 0aef43a

@chriselrod
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 updated: JuliaRegistries/General/33405

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.1.6 -m "<description of version>" 0aef43abe05c4218907e37c94210d0dd8380a848
git push origin v0.1.6

Please sign in to comment.