Skip to content

Commit 3628172

Browse files
authored
Merge pull request #20 from ranocha/test_at-pstats
add smoke tests for at-pstats
2 parents 8ce54a6 + 4517a9d commit 3628172

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/runtests.jl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,25 @@ end
7777
@test parse_groups("(cpu-cycles,instructions) : u ") == parse_groups("(cpu-cycles,instructions):u")
7878
end
7979

80+
81+
@testset "@pstats" begin
82+
n = 10^3
83+
a = randn(n)
84+
b = randn(n)
85+
c = randn(n)
86+
dest = zero(a)
87+
88+
function foo!(dest, a, b, c)
89+
@. dest = a + b * c
90+
sum(dest)
91+
end
92+
93+
# Simple smoke tests
94+
@test_nowarn LinuxPerf.list()
95+
@pstats foo!(dest, a, b, c)
96+
97+
@pstats "cpu-cycles,(instructions,branch-instructions,branch-misses),(task-clock,context-switches,cpu-migrations,page-faults),(L1-dcache-load-misses,L1-dcache-loads,L1-icache-load-misses),(dTLB-load-misses,dTLB-loads)" foo!(dest, a, b, c)
98+
end
99+
100+
80101
end

0 commit comments

Comments
 (0)