Skip to content

Commit 4bfa015

Browse files
authored
Merge pull request #244 from JuliaParallel/jps/fix-clocks-macos
Temp. fix for clocks on non-Linux
2 parents 247f0ba + f2c457f commit 4bfa015

File tree

5 files changed

+64
-11
lines changed

5 files changed

+64
-11
lines changed

Diff for: .ci/test.jl

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Pkg
2+
3+
Pkg.update()
4+
5+
root_directory = dirname(@__DIR__)
6+
7+
bpfnative = Pkg.PackageSpec(path = root_directory)
8+
Pkg.develop(bpfnative)
9+
Pkg.precompile()
10+
Pkg.test("Dagger")

Diff for: .github/workflows/ci-julia-1.6-nightly.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI (Julia 1.6-nightly)
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags: '*'
7+
pull_request:
8+
defaults:
9+
run:
10+
shell: bash
11+
jobs:
12+
CI-julia-1-6-nightly:
13+
name: CI-julia-1-6-nightly
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
version:
19+
- '1.6-nightly'
20+
os:
21+
- ubuntu-latest
22+
- macOS-latest
23+
#- windows-latest
24+
arch:
25+
- x64
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: julia-actions/setup-julia@v1
29+
with:
30+
version: ${{ matrix.version }}
31+
arch: ${{ matrix.arch }}
32+
- uses: actions/cache@v1
33+
env:
34+
cache-name: cache-artifacts
35+
with:
36+
path: ~/.julia/artifacts
37+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-test-${{ env.cache-name }}-
40+
${{ runner.os }}-test-
41+
${{ runner.os }}-
42+
- run: julia .ci/test.jl
43+
- uses: julia-actions/julia-processcoverage@v1
44+
- uses: codecov/codecov-action@v1
45+
with:
46+
file: lcov.info

Diff for: Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Dagger"
22
uuid = "d58978e5-989f-55fb-8d15-ea34adc7bf54"
3-
version = "0.11.7"
3+
version = "0.11.8"
44

55
[deps]
66
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"

Diff for: src/sch/Sch.jl

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ import ..Dagger: Context, Processor, Thunk, ThunkFuture, ThunkFailedException, C
99
const OneToMany = Dict{Thunk, Set{Thunk}}
1010

1111
include("util.jl")
12-
if Sys.isunix()
13-
include("unix.jl")
14-
else
15-
# FIXME
16-
cputhreadtime() = time_ns()
17-
end
12+
include("clocks.jl")
1813
include("fault-handler.jl")
1914
include("dynamic.jl")
2015

Diff for: src/sch/unix.jl renamed to src/sch/clocks.jl

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ elseif Sys.isapple() # Version 10.12 required
2828
const CLOCK_MONOTONIC = Cint(6)
2929
const CLOCK_PROCESS_CPUTIME_ID = Cint(12)
3030
else
31-
error("""
32-
BenchmarkTools doesn't currently support your operating system.
33-
Please file an issue, your kernel is $(Sys.KERNEL)
34-
""")
31+
@inline cputhreadtime() = time_ns()
32+
return
3533
end
3634

3735
@inline function clock_gettime(cid)
@@ -48,9 +46,13 @@ end
4846
maketime(clock_gettime(CLOCK_PROCESS_CPUTIME_ID))
4947
end
5048

49+
@static if Sys.islinux()
5150
@inline function cputhreadtime()
5251
maketime(clock_gettime(CLOCK_THREAD_CPUTIME_ID))
5352
end
53+
else
54+
@inline cputhreadtime() = time_ns()
55+
end
5456

5557
struct Measurement
5658
realtime::TimeSpec

0 commit comments

Comments
 (0)