Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
40
Issues
40
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
e4e0624d
Commit
e4e0624d
authored
Nov 30, 2016
by
John Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added quicksort in test_perftarget_runnable.py
parent
7ff9f4be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
test_pertarget_runnable.py
tests/test_jit/test_pertarget_runnable.py
+36
-0
No files found.
tests/test_jit/test_pertarget_runnable.py
View file @
e4e0624d
...
...
@@ -32,3 +32,39 @@ def test_fibonacci_iterative():
bdlgen
.
mu
.
current_thread_as_mu_thread
(
rmu
.
null
(
rmu
.
MuCPtr
))
assert
fnc
(
rffi
.
cast
(
rffi
.
ULONGLONG
,
20
))
@
may_spawn_proc
def
test_quicksort
():
from
perftarget.quicksort
import
quicksort
,
setup
,
teardown
fnc
,
(
db
,
bdlgen
)
=
fncptr_from_rpy_func
(
quicksort
,
[
rffi
.
CArrayPtr
(
rffi
.
LONGLONG
),
lltype
.
Signed
,
lltype
.
Signed
],
lltype
.
Void
)
bdlgen
.
mu
.
current_thread_as_mu_thread
(
rmu
.
null
(
rmu
.
MuCPtr
))
N
=
100
arr
,
s
,
e
=
setup
(
100
)
lst
=
list
(
arr
)
fnc
(
arr
,
s
,
e
)
lst
.
sort
()
for
i
in
range
(
len
(
lst
)):
assert
lst
[
i
]
==
arr
[
i
]
teardown
(
arr
,
s
,
e
)
@
may_spawn_proc
def
test_quicksort_handcraft
():
from
perftarget.quicksort
import
build_quicksort_bundle
,
setup
,
teardown
fnc
,
(
mu
,
ctx
,
bldr
)
=
fncptr_from_py_script
(
build_quicksort_bundle
,
None
,
'quicksort'
,
[
rffi
.
CArrayPtr
(
rffi
.
LONGLONG
),
lltype
.
Signed
,
lltype
.
Signed
],
lltype
.
Void
)
mu
.
current_thread_as_mu_thread
(
rmu
.
null
(
rmu
.
MuCPtr
))
N
=
100
arr
,
s
,
e
=
setup
(
100
)
lst
=
list
(
arr
)
fnc
(
arr
,
s
,
e
)
lst
.
sort
()
for
i
in
range
(
len
(
lst
)):
assert
lst
[
i
]
==
arr
[
i
]
teardown
(
arr
,
s
,
e
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment