-
Notifications
You must be signed in to change notification settings - Fork 47
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
Open
vchuravy
wants to merge
26
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.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1ec75f7
Use ParallelTestRunner with a custom TestRecord
vchuravy 6b24182
fix custom_record implementation
vchuravy d6a9fd4
fixup! fix custom_record implementation
vchuravy 8ea8da8
fixup! fixup! fix custom_record implementation
vchuravy 7c41090
adopt to refactor
vchuravy f4bcd7d
Switch to test_transform
vchuravy 717d2ee
Switch to test_transform
vchuravy 4122693
fix name for gpuarrays testsuite
vchuravy d484c13
fix execution test
vchuravy 5fbf81f
give JuliaTesting/ParallelTestRunner#59 a whirl
vchuravy fe5c1c0
Apply suggestion from @vchuravy
vchuravy 79b6771
Remove superfluous testsets.
maleadt 11abcbf
Simplify and fix.
maleadt 342e426
Support new filtering API.
maleadt bb188b7
Limit to PoCL 7.0.
maleadt 68b11a5
Try to work around Windows failure.
maleadt bad16d3
Revert "Limit to PoCL 7.0."
christiangnrd 6996714
PTR 2
christiangnrd b6e2e56
Apply suggestion from @christiangnrd
christiangnrd cc61c57
Rebase omission
christiangnrd 325b0d4
Increase timeout
christiangnrd 0268d96
`init_worker_code`
christiangnrd 6e0dfc5
macOS 26
christiangnrd 55ec0d0
Run tests with
christiangnrd 8140156
Lower max RSS on macOS
christiangnrd 5edfe42
Less
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,116 +1,114 @@ | ||
| 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] | ||
| end | ||
| @testset "fill(::SubArray)" begin | ||
| xs = OpenCL.zeros(Float32, 3) | ||
| fill!(view(xs, 2:2), 1) | ||
| @test Array(xs) == [0, 1, 0] | ||
| end | ||
|
|
||
| @testset "reinterpret of view with non-aligned offset" begin | ||
| # reinterpreting a view to a larger element type where the byte offset | ||
| # is not a multiple of the new element size | ||
| a = CLArray(Int32[1,2,3,4,5,6,7,8,9]) | ||
| v = view(a, 2:7) # offset of 1 Int32 = 4 bytes | ||
| r = reinterpret(Int64, v) # Int64 = 8 bytes; 4 is not a multiple of 8 | ||
| @test Array(r) == reinterpret(Int64, @view Array(a)[2:7]) | ||
| @testset "reinterpret of view with non-aligned offset" begin | ||
| # reinterpreting a view to a larger element type where the byte offset | ||
| # is not a multiple of the new element size | ||
| a = CLArray(Int32[1,2,3,4,5,6,7,8,9]) | ||
| v = view(a, 2:7) # offset of 1 Int32 = 4 bytes | ||
| r = reinterpret(Int64, v) # Int64 = 8 bytes; 4 is not a multiple of 8 | ||
| @test Array(r) == reinterpret(Int64, @view Array(a)[2:7]) | ||
| 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.