Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
56f1c5a8
Commit
56f1c5a8
authored
Jul 01, 2019
by
Mccaskey, Alex
Browse files
fixing bug
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
33cc54ca
Pipeline
#61774
passed with stages
in 10 minutes and 29 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/xacc.in
View file @
56f1c5a8
...
...
@@ -84,7 +84,8 @@ def main(argv=None):
if
not
opts
.
keep_tmp_src
:
os
.
remove
(
'.'
+
opts
.
file
.
replace
(
'.'
,
'_out.'
))
os
.
remove
(
'.'
+
opts
.
file
.
replace
(
'.'
,
'_pragma_out.'
))
os
.
remove
(
'.'
+
opts
.
file
.
replace
(
'.'
,
'_pragma_out.'
))
if
os
.
path
.
exists
(
'.'
+
opts
.
file
.
replace
(
'.'
,
'_pragma_out.'
))
else
None
return
0
...
...
tools/compiler/clang/KernelVisitor.cpp
View file @
56f1c5a8
...
...
@@ -117,7 +117,7 @@ bool KernelVisitor::VisitFunctionDecl(FunctionDecl *F) {
", std::shared_ptr<xacc::Observable> obs)"
);
}
else
{
replacement
+=
"function = function->operator()(params);
\n
"
;
if
(
F
->
getAttrs
().
size
()
>
1
)
replacement
+=
"function = function->operator()(params);
\n
"
;
replacement
+=
"acc->execute("
+
bufferName
+
",function);
\n
"
;
}
replacement
+=
"}
\n
"
;
...
...
tools/compiler/clang/XACCPragmaHandler.hpp
View file @
56f1c5a8
...
...
@@ -28,6 +28,7 @@ protected:
// PragmaAttributeInfo(ParsedAttributes &Attributes) :
// Attributes(Attributes) {}
};
public:
std
::
string
observable
=
""
;
...
...
tools/compiler/clang/xacc-driver.in.cpp
View file @
56f1c5a8
...
...
@@ -97,6 +97,7 @@ protected:
CI
.
getDiagnosticClient
().
EndSourceFile
();
if
(
!
ph
->
functionName
.
empty
())
{
rewriter
.
ReplaceText
(
map
[
ph
->
functionName
].
getLocWithOffset
(
2
),
1
,
") __observe__(
\"
"
+
ph
->
observable
+
"
\"
)"
);
...
...
@@ -122,6 +123,7 @@ protected:
}
outFile
.
close
();
}
}
};
...
...
@@ -217,6 +219,10 @@ int main(int argc, char **argv) {
std
::
ifstream
t2
(
outName
);
std
::
string
src2
((
std
::
istreambuf_iterator
<
char
>
(
t2
)),
std
::
istreambuf_iterator
<
char
>
());
if
(
src2
.
empty
())
{
src2
=
src
;
}
auto
action2
=
new
XACCFrontendAction
(
Rewrite2
,
fileName
);
if
(
!
tooling
::
runToolOnCodeWithArgs
(
action2
,
src2
,
args
))
{
xacc
::
error
(
"Error running xacc compiler."
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment