Move testsuite to ParallelTestRunner#564
Open
christiangnrd wants to merge 8 commits intoJuliaGPU:masterfrom
Open
Move testsuite to ParallelTestRunner#564christiangnrd wants to merge 8 commits intoJuliaGPU:masterfrom
christiangnrd wants to merge 8 commits intoJuliaGPU:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #564 +/- ##
==========================================
- Coverage 79.42% 79.42% -0.01%
==========================================
Files 48 48
Lines 3150 3149 -1
==========================================
- Hits 2502 2501 -1
Misses 648 648 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/test/execution.jl b/test/execution.jl
index 1e2e179..d4fc794 100644
--- a/test/execution.jl
+++ b/test/execution.jl
@@ -108,10 +108,10 @@ end
export external_dummy
external_dummy() = return
end
- import .KernelModule
+ import .KernelModule
@oneapi KernelModule.external_dummy()
@eval begin
- using .KernelModule
+ using .KernelModule
@oneapi external_dummy()
end
diff --git a/test/runtests.jl b/test/runtests.jl
index 06d77db..c5f46dc 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -37,10 +37,12 @@ init_worker_code = quote
include($gpuarrays_testsuite)
testf(f, xs...; kwargs...) = TestSuite.compare(f, oneArray, xs...; kwargs...)
- const eltypes = [Int16, Int32, Int64,
- Complex{Int16}, Complex{Int32}, Complex{Int64},
- Float16, Float32,
- ComplexF32]
+ const eltypes = [
+ Int16, Int32, Int64,
+ Complex{Int16}, Complex{Int32}, Complex{Int64},
+ Float16, Float32,
+ ComplexF32,
+ ]
const float16_supported = oneL0.module_properties(device()).fp16flags & oneL0.ZE_DEVICE_MODULE_FLAG_FP16 == oneL0.ZE_DEVICE_MODULE_FLAG_FP16
if float16_supported
@@ -58,12 +60,12 @@ init_worker_code = quote
# NOTE: based on test/pkg.jl::capture_stdout, but doesn't discard exceptions
macro grab_output(ex)
- quote
+ return quote
mktemp() do fname, fout
ret = nothing
open(fname, "w") do fout
redirect_stdout(fout) do
- ret = $(esc(ex))
+ ret = $(esc(ex))
end
end
ret, read(fname, String)
@@ -74,32 +76,38 @@ init_worker_code = quote
# Run some code on-device
macro on_device(ex...)
code = ex[end]
- kwargs = ex[1:end-1]
+ kwargs = ex[1:(end - 1)]
@gensym kernel
- esc(quote
- let
- function $kernel()
- $code
- return
+ return esc(
+ quote
+ let
+ function $kernel()
+ $code
+ return
end
- oneAPI.@sync @oneapi $(kwargs...) $kernel()
+ oneAPI.@sync @oneapi $(kwargs...) $kernel()
end
- end)
+ end
+ )
end
# helper function for sinking a value to prevent the callee from getting optimized away
@inline sink(i::Int32) =
- Base.llvmcall("""%slot = alloca i32
- store volatile i32 %0, i32* %slot
- %value = load volatile i32, i32* %slot
- ret i32 %value""", Int32, Tuple{Int32}, i)
+ Base.llvmcall(
+ """%slot = alloca i32
+ store volatile i32 %0, i32* %slot
+ %value = load volatile i32, i32* %slot
+ ret i32 %value""", Int32, Tuple{Int32}, i
+ )
@inline sink(i::Int64) =
- Base.llvmcall("""%slot = alloca i64
- store volatile i64 %0, i64* %slot
- %value = load volatile i64, i64* %slot
- ret i64 %value""", Int64, Tuple{Int64}, i)
+ Base.llvmcall(
+ """%slot = alloca i64
+ store volatile i64 %0, i64* %slot
+ %value = load volatile i64, i64* %slot
+ ret i64 %value""", Int64, Tuple{Int64}, i
+ )
end
init_code = quote
@@ -107,8 +115,8 @@ init_code = quote
import ..TestSuite, ..testf
import ..eltypes, ..float16_supported, ..float64_supported,
- ..validation_layer, ..parameter_validation,
- ..@grab_output, ..@on_device, ..sink
+ ..validation_layer, ..parameter_validation,
+ ..@grab_output, ..@on_device, ..sink
end
runtests(oneAPI, args; testsuite, init_code, init_worker_code) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.