Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rinat Striungis
hpc
Commits
a3882aa9
Commit
a3882aa9
authored
9 years ago
by
Thomas Miedema
Browse files
Options
Downloads
Patches
Plain Diff
Testsuite: AMPify tests/raytrace/Eval.hs
parent
0741f656
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/raytrace/Eval.hs
+19
-4
19 additions, 4 deletions
tests/raytrace/Eval.hs
tests/raytrace/test.T
+11
-4
11 additions, 4 deletions
tests/raytrace/test.T
with
30 additions
and
8 deletions
tests/raytrace/Eval.hs
+
19
−
4
View file @
a3882aa9
...
...
@@ -5,6 +5,7 @@
module
Eval
where
import
Control.Monad
import
Data.Array
import
Geometry
...
...
@@ -22,9 +23,16 @@ class Monad m => MonadEval m where
newtype
Pure
a
=
Pure
a
deriving
Show
instance
Functor
Pure
where
fmap
=
liftM
instance
Applicative
Pure
where
pure
=
Pure
(
<*>
)
=
ap
instance
Monad
Pure
where
Pure
x
>>=
k
=
k
x
return
=
P
ure
return
=
p
ure
fail
s
=
error
s
instance
MonadEval
Pure
where
...
...
@@ -248,7 +256,7 @@ doPrimOp primOp op args
types
=
getPrimOpType
primOp
-- Render is somewhat funny, becau
a
se it can only get called at top level.
-- Render is somewhat funny, because it can only get called at top level.
-- All other operations are purely functional.
doAllOp
::
PrimOp
->
GMLOp
->
Stack
->
IO
Stack
...
...
@@ -286,11 +294,18 @@ newtype Abs a = Abs { runAbs :: Int -> AbsState a }
data
AbsState
a
=
AbsState
a
!
Int
|
AbsFail
String
instance
Functor
Abs
where
fmap
=
liftM
instance
Applicative
Abs
where
pure
x
=
Abs
(
\
n
->
AbsState
x
n
)
(
<*>
)
=
ap
instance
Monad
Abs
where
(
Abs
fn
)
>>=
k
=
Abs
(
\
s
->
case
fn
s
of
AbsState
r
s'
->
runAbs
(
k
r
)
s'
AbsFail
m
->
AbsFail
m
)
return
x
=
Abs
(
\
n
->
AbsState
x
n
)
return
=
pure
fail
s
=
Abs
(
\
n
->
AbsFail
s
)
instance
MonadEval
Abs
where
...
...
@@ -325,7 +340,7 @@ mainEval prog = do { stk <- eval (State emptyEnv [] prog)
}
-}
done
=
"Items still on stack at (successful
l
) termination of program"
done
=
"Items still on stack at (successful) termination of program"
------------------------------------------------------------------------------
-- testing
...
...
This diff is collapsed.
Click to expand it.
tests/raytrace/test.T
+
11
−
4
View file @
a3882aa9
...
...
@@ -2,8 +2,15 @@ setTestOpts([omit_ways(['ghci']), when(fast(), skip)])
hpc_prefix
=
"
perl ../hpcrun.pl --clear --exeext={exeext} --hpc={hpc}
"
test
('
hpc_raytrace
',
\
[
when
(
fast
(),
skip
),
cmd_prefix
(
hpc_prefix
),
reqlib
('
parsec
')
],
\
multimod_compile_and_run
,
\
['
Main
','
-fhpc -package parsec
'])
# TODO. It is unclear what the purpose of this test is. It produces lots of
# output, but the expected output file is missing. I (thomie) added
# the ignore_output setup function, just to make the test pass for the
# moment.
# Note that the subdirectory tixs also has a test.T file, and those tests
# depend on some of the files in this directory.
# Also note that testsuite/tests/programs/galois_raytrace has a similar (but
# not the same) copy of this program.
test
('
hpc_raytrace
',
[
cmd_prefix
(
hpc_prefix
),
reqlib
('
parsec
'),
ignore_output
],
multimod_compile_and_run
,
['
Main
','
-fhpc -package parsec
'])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment