Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
72ac8c95
Commit
72ac8c95
authored
8 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
don’t use sequences in vector fast paths
parent
2c47cd13
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/VectorFastPaths.java
+11
-15
11 additions, 15 deletions
...uffle/r/nodes/builtin/base/fastpaths/VectorFastPaths.java
with
11 additions
and
15 deletions
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/VectorFastPaths.java
+
11
−
15
View file @
72ac8c95
...
...
@@ -25,7 +25,7 @@ package com.oracle.truffle.r.nodes.builtin.base.fastpaths;
import
com.oracle.truffle.api.dsl.Cached
;
import
com.oracle.truffle.api.dsl.Fallback
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.
api
.profile
s.Condition
Profile
;
import
com.oracle.truffle.
r.nodes
.profile
.VectorLength
Profile
;
import
com.oracle.truffle.r.runtime.data.RDataFactory
;
import
com.oracle.truffle.r.runtime.data.RMissing
;
import
com.oracle.truffle.r.runtime.data.model.RAbstractDoubleVector
;
...
...
@@ -43,20 +43,18 @@ public abstract class VectorFastPaths {
@Specialization
protected
RAbstractIntVector
get
(
int
length
,
@Cached
(
"createBinaryProfile()"
)
ConditionProfile
emptyProfile
)
{
if
(
emptyProfile
.
profile
(
length
==
0
))
{
return
RDataFactory
.
createIntVector
(
0
);
}
else
if
(
length
>
0
)
{
return
RDataFactory
.
createIntSequence
(
0
,
0
,
length
);
@Cached
(
"create()"
)
VectorLengthProfile
profile
)
{
if
(
length
>
0
)
{
return
RDataFactory
.
createIntVector
(
profile
.
profile
(
length
));
}
return
null
;
}
@Specialization
protected
RAbstractIntVector
get
(
double
length
,
@Cached
(
"create
BinaryProfile()"
)
Condition
Profile
emptyP
rofile
)
{
@Cached
(
"create
()"
)
VectorLength
Profile
p
rofile
)
{
if
(!
Double
.
isNaN
(
length
))
{
return
get
((
int
)
length
,
emptyP
rofile
);
return
get
((
int
)
length
,
p
rofile
);
}
return
null
;
}
...
...
@@ -77,20 +75,18 @@ public abstract class VectorFastPaths {
@Specialization
protected
RAbstractDoubleVector
get
(
int
length
,
@Cached
(
"createBinaryProfile()"
)
ConditionProfile
emptyProfile
)
{
if
(
emptyProfile
.
profile
(
length
==
0
))
{
return
RDataFactory
.
createDoubleVector
(
0
);
}
else
if
(
length
>
0
)
{
return
RDataFactory
.
createDoubleSequence
(
0
,
0
,
length
);
@Cached
(
"create()"
)
VectorLengthProfile
profile
)
{
if
(
length
>
0
)
{
return
RDataFactory
.
createDoubleVector
(
profile
.
profile
(
length
));
}
return
null
;
}
@Specialization
protected
RAbstractDoubleVector
get
(
double
length
,
@Cached
(
"create
BinaryProfile()"
)
Condition
Profile
emptyP
rofile
)
{
@Cached
(
"create
()"
)
VectorLength
Profile
p
rofile
)
{
if
(!
Double
.
isNaN
(
length
))
{
return
get
((
int
)
length
,
emptyP
rofile
);
return
get
((
int
)
length
,
p
rofile
);
}
return
null
;
}
...
...
This diff is collapsed.
Click to expand it.
Julien Lopez
@jlopez
mentioned in commit
b061bfd5
·
8 years ago
mentioned in commit
b061bfd5
mentioned in commit b061bfd58a77006fc0de4612e35947e5e7d22c58
Toggle commit list
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