-
Notifications
You must be signed in to change notification settings - Fork 46
Use ParallelTestRunner #390
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
Draft
vchuravy
wants to merge
23
commits into
master
Choose a base branch
from
vc/ptr_1.1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7d37004
Use ParallelTestRunner with a custom TestRecord
vchuravy f2c4b7a
fix custom_record implementation
vchuravy 2d779fe
fixup! fix custom_record implementation
vchuravy 1289a6a
fixup! fixup! fix custom_record implementation
vchuravy b3e9f4d
adopt to refactor
vchuravy 571807d
Switch to test_transform
vchuravy 6a26e6e
Switch to test_transform
vchuravy e641b7f
fix name for gpuarrays testsuite
vchuravy 7a8ab34
fix execution test
vchuravy 3f55207
give JuliaTesting/ParallelTestRunner#59 a whirl
vchuravy 31c279a
Apply suggestion from @vchuravy
vchuravy d03adac
Remove superfluous testsets.
maleadt 9af8817
Simplify and fix.
maleadt 8b06156
Support new filtering API.
maleadt da7c93d
Limit to PoCL 7.0.
maleadt 802387f
Try to work around Windows failure.
maleadt 933dba8
Revert "Limit to PoCL 7.0."
christiangnrd 486462a
PTR 2
christiangnrd 7539202
Apply suggestion from @christiangnrd
christiangnrd 3e80a4a
Rebase omission
christiangnrd 577ccad
Increase timeout
christiangnrd 77abb47
`init_worker_code`
christiangnrd 589c576
[temp]
christiangnrd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,107 +1,105 @@ | ||
| using LinearAlgebra | ||
| import Adapt | ||
|
|
||
| @testset "CLArray" begin | ||
| @testset "constructors" begin | ||
| xs = CLArray{Int, 2, cl.Buffer}(undef, 2, 3) | ||
| @test collect(CLArray([1 2; 3 4])) == [1 2; 3 4] | ||
| @test testf(vec, rand(Float32, 5, 3)) | ||
| @test Base.elsize(xs) == sizeof(Int) | ||
| @test CLArray{Int, 2}(xs) === xs | ||
|
|
||
| @test device_accessible(xs) | ||
| @test !host_accessible(xs) | ||
| @test_throws ArgumentError Base.unsafe_convert(Ptr{Int}, xs) | ||
| @test_throws ArgumentError Base.unsafe_convert(Ptr{Float32}, xs) | ||
|
|
||
| @test collect(OpenCL.zeros(Float32, 2, 2)) == zeros(Float32, 2, 2) | ||
| @test collect(OpenCL.ones(Float32, 2, 2)) == ones(Float32, 2, 2) | ||
|
|
||
| @test collect(OpenCL.fill(0, 2, 2)) == zeros(Int, 2, 2) | ||
| @test collect(OpenCL.fill(1, 2, 2)) == ones(Int, 2, 2) | ||
| end | ||
| @testset "constructors" begin | ||
| xs = CLArray{Int, 2, cl.Buffer}(undef, 2, 3) | ||
| @test collect(CLArray([1 2; 3 4])) == [1 2; 3 4] | ||
| @test testf(vec, rand(Float32, 5, 3)) | ||
| @test Base.elsize(xs) == sizeof(Int) | ||
| @test CLArray{Int, 2}(xs) === xs | ||
|
|
||
| @test device_accessible(xs) | ||
| @test !host_accessible(xs) | ||
| @test_throws ArgumentError Base.unsafe_convert(Ptr{Int}, xs) | ||
| @test_throws ArgumentError Base.unsafe_convert(Ptr{Float32}, xs) | ||
|
|
||
| @test collect(OpenCL.zeros(Float32, 2, 2)) == zeros(Float32, 2, 2) | ||
| @test collect(OpenCL.ones(Float32, 2, 2)) == ones(Float32, 2, 2) | ||
|
|
||
| @test collect(OpenCL.fill(0, 2, 2)) == zeros(Int, 2, 2) | ||
| @test collect(OpenCL.fill(1, 2, 2)) == ones(Int, 2, 2) | ||
| end | ||
|
|
||
| @testset "adapt" begin | ||
| A = rand(Float32, 3, 3) | ||
| dA = CLArray(A) | ||
| @test Adapt.adapt(Array, dA) == A | ||
| @test Adapt.adapt(CLArray, A) isa CLArray | ||
| @test Array(Adapt.adapt(CLArray, A)) == A | ||
| end | ||
| @testset "adapt" begin | ||
| A = rand(Float32, 3, 3) | ||
| dA = CLArray(A) | ||
| @test Adapt.adapt(Array, dA) == A | ||
| @test Adapt.adapt(CLArray, A) isa CLArray | ||
| @test Array(Adapt.adapt(CLArray, A)) == A | ||
| end | ||
|
|
||
| @testset "reshape" begin | ||
| A = [ | ||
| 1 2 3 4 | ||
| 5 6 7 8 | ||
| ] | ||
| gA = reshape(CLArray(A), 1, 8) | ||
| _A = reshape(A, 1, 8) | ||
| _gA = Array(gA) | ||
| @test all(_A .== _gA) | ||
| A = [1, 2, 3, 4] | ||
| gA = reshape(CLArray(A), 4) | ||
| end | ||
| @testset "reshape" begin | ||
| A = [ | ||
| 1 2 3 4 | ||
| 5 6 7 8 | ||
| ] | ||
| gA = reshape(CLArray(A), 1, 8) | ||
| _A = reshape(A, 1, 8) | ||
| _gA = Array(gA) | ||
| @test all(_A .== _gA) | ||
| A = [1, 2, 3, 4] | ||
| gA = reshape(CLArray(A), 4) | ||
| end | ||
|
|
||
| @testset "fill(::SubArray)" begin | ||
| xs = OpenCL.zeros(Float32, 3) | ||
| fill!(view(xs, 2:2), 1) | ||
| @test Array(xs) == [0, 1, 0] | ||
| @testset "fill(::SubArray)" begin | ||
| xs = OpenCL.zeros(Float32, 3) | ||
| fill!(view(xs, 2:2), 1) | ||
| @test Array(xs) == [0, 1, 0] | ||
| end | ||
| # TODO: Look into how to port the @sync | ||
|
|
||
| if cl.USMBackend() in cl.supported_memory_backends(cl.device()) | ||
| @testset "shared buffers & unsafe_wrap" begin | ||
| a = CLVector{Int, cl.UnifiedSharedMemory}(undef, 2) | ||
|
|
||
| # check that basic operations work on arrays backed by shared memory | ||
| fill!(a, 40) | ||
| a .+= 2 | ||
| @test Array(a) == [42, 42] | ||
|
|
||
| # derive an Array object and test that the memory keeps in sync | ||
| b = unsafe_wrap(Array, a) | ||
| b[1] = 100 | ||
| @test Array(a) == [100, 42] | ||
| copyto!(a, 2, [200], 1, 1) | ||
| cl.finish(cl.queue()) | ||
| @test b == [100, 200] | ||
| end | ||
| # TODO: Look into how to port the @sync | ||
|
|
||
| if cl.USMBackend() in cl.supported_memory_backends(cl.device()) | ||
| @testset "shared buffers & unsafe_wrap" begin | ||
| a = CLVector{Int, cl.UnifiedSharedMemory}(undef, 2) | ||
|
|
||
| # check that basic operations work on arrays backed by shared memory | ||
| fill!(a, 40) | ||
| a .+= 2 | ||
| @test Array(a) == [42, 42] | ||
|
|
||
| # derive an Array object and test that the memory keeps in sync | ||
| b = unsafe_wrap(Array, a) | ||
| b[1] = 100 | ||
| @test Array(a) == [100, 42] | ||
| copyto!(a, 2, [200], 1, 1) | ||
| cl.finish(cl.queue()) | ||
| @test b == [100, 200] | ||
| end | ||
|
|
||
| # https://github.com/JuliaGPU/CUDA.jl/issues/2191 | ||
| @testset "preserving memory types" begin | ||
| a = CLVector{Int, cl.UnifiedSharedMemory}([1]) | ||
| @test OpenCL.memtype(a) == cl.UnifiedSharedMemory | ||
|
|
||
| # unified-ness should be preserved | ||
| b = a .+ 1 | ||
| @test OpenCL.memtype(b) == cl.UnifiedSharedMemory | ||
|
|
||
| # when there's a conflict, we should defer to unified memory | ||
| c = CLVector{Int, cl.UnifiedSharedMemory}([1]) | ||
| d = CLVector{Int, cl.UnifiedDeviceMemory}([1]) | ||
| e = c .+ d | ||
| @test OpenCL.memtype(e) == cl.UnifiedSharedMemory | ||
| end | ||
|
|
||
| # https://github.com/JuliaGPU/CUDA.jl/issues/2191 | ||
| @testset "preserving memory types" begin | ||
| a = CLVector{Int, cl.UnifiedSharedMemory}([1]) | ||
| @test OpenCL.memtype(a) == cl.UnifiedSharedMemory | ||
|
|
||
| # unified-ness should be preserved | ||
| b = a .+ 1 | ||
| @test OpenCL.memtype(b) == cl.UnifiedSharedMemory | ||
|
|
||
| # when there's a conflict, we should defer to unified memory | ||
| c = CLVector{Int, cl.UnifiedSharedMemory}([1]) | ||
| d = CLVector{Int, cl.UnifiedDeviceMemory}([1]) | ||
| e = c .+ d | ||
| @test OpenCL.memtype(e) == cl.UnifiedSharedMemory | ||
| end | ||
| end | ||
|
|
||
| @testset "resizing" begin | ||
| a = CLArray([1, 2, 3]) | ||
| @testset "resizing" begin | ||
| a = CLArray([1, 2, 3]) | ||
|
|
||
| resize!(a, 3) | ||
| @test length(a) == 3 | ||
| @test Array(a) == [1, 2, 3] | ||
| resize!(a, 3) | ||
| @test length(a) == 3 | ||
| @test Array(a) == [1, 2, 3] | ||
|
|
||
| resize!(a, 5) | ||
| @test length(a) == 5 | ||
| @test Array(a)[1:3] == [1, 2, 3] | ||
| resize!(a, 5) | ||
| @test length(a) == 5 | ||
| @test Array(a)[1:3] == [1, 2, 3] | ||
|
|
||
| resize!(a, 2) | ||
| @test length(a) == 2 | ||
| @test Array(a)[1:2] == [1, 2] | ||
| resize!(a, 2) | ||
| @test length(a) == 2 | ||
| @test Array(a)[1:2] == [1, 2] | ||
|
|
||
| b = CLArray{Int}(undef, 0) | ||
| @test length(b) == 0 | ||
| resize!(b, 1) | ||
| @test length(b) == 1 | ||
| end | ||
| b = CLArray{Int}(undef, 0) | ||
| @test length(b) == 0 | ||
| resize!(b, 1) | ||
| @test length(b) == 1 | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,25 @@ | ||
| @testset "CmdQueue" begin | ||
| @testset "constructor" begin | ||
| @test cl.CmdQueue() != nothing | ||
| @test cl.CmdQueue(:profile) != nothing | ||
| try | ||
| cl.CmdQueue(:out_of_order) | ||
| cl.CmdQueue((:profile, :out_of_order)) | ||
| catch err | ||
| @warn("Platform $(cl.device().platform.name) does not seem to " * | ||
| "suport out of order queues: \n$err",maxlog=1, | ||
| exception=(err, catch_backtrace())) | ||
| end | ||
| @test_throws ArgumentError cl.CmdQueue(:unrecognized_flag) | ||
| for flag in [:profile, :out_of_order] | ||
| @test_throws ArgumentError cl.CmdQueue((flag, :unrecognized_flag)) | ||
| @test_throws ArgumentError cl.CmdQueue((flag, flag)) | ||
| end | ||
| @testset "constructor" begin | ||
| @test cl.CmdQueue() != nothing | ||
| @test cl.CmdQueue(:profile) != nothing | ||
| try | ||
| cl.CmdQueue(:out_of_order) | ||
| cl.CmdQueue((:profile, :out_of_order)) | ||
| catch err | ||
| @warn("Platform $(cl.device().platform.name) does not seem to " * | ||
| "suport out of order queues: \n$err",maxlog=1, | ||
| exception=(err, catch_backtrace())) | ||
| end | ||
|
|
||
| @testset "info" begin | ||
| q = cl.CmdQueue() | ||
| @test q.context == cl.context() | ||
| @test q.device == cl.device() | ||
| @test q.reference_count > 0 | ||
| @test typeof(q.properties) == cl.cl_command_queue_properties | ||
| @test_throws ArgumentError cl.CmdQueue(:unrecognized_flag) | ||
| for flag in [:profile, :out_of_order] | ||
| @test_throws ArgumentError cl.CmdQueue((flag, :unrecognized_flag)) | ||
| @test_throws ArgumentError cl.CmdQueue((flag, flag)) | ||
| end | ||
| end | ||
|
|
||
| @testset "info" begin | ||
| q = cl.CmdQueue() | ||
| @test q.context == cl.context() | ||
| @test q.device == cl.device() | ||
| @test q.reference_count > 0 | ||
| @test typeof(q.properties) == cl.cl_command_queue_properties | ||
| end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.