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
qcor
Commits
25d1e9d3
Commit
25d1e9d3
authored
Mar 26, 2019
by
Mccaskey, Alex
Browse files
Merge branch 'master' of
https://code.ornl.gov/qci/qcor
parents
6205ed1c
0da8c397
Pipeline
#43864
passed with stages
in 2 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
compiler/clang/README.md
View file @
25d1e9d3
...
...
@@ -8,25 +8,27 @@ clang++-9 -std=c++11 -Xclang -load -Xclang compiler/clang/libqcor-ast-plugin.so
A better example
```
bash
clang++-9
-std
=
c++11
-Xclang
-load
-Xclang
compiler/clang/libqcor-ast-plugin.so
-Xclang
-add-plugin
-Xclang
enable-quantum
-Xclang
-plugin-arg-enable-quantum
-Xclang
accelerator
-Xclang -plugin-arg-enable-quantum -Xclang
tnqv
m
-Xclang
-plugin-arg-enable-quantum
-Xclang
local-ib
m
-Xclang
-plugin-arg-enable-quantum
-Xclang
transform
-Xclang
-plugin-arg-enable-quantum
-Xclang
circuit-optimizer
-I
/root/.xacc/include/xacc
-I
/root/.xacc/include/cppmicroservices4
-I
/home/project/qcor/runtime
-L
/home/project/qcor/build/runtime
-lqcor
-L
/root/.xacc/lib
-lxacc
test.cpp
-o
test
```
test.cpp looks like this
```
cpp
#include
"qcor.hpp"
#include <stdio.h>
#include <string>
int main() {
xacc::Initialize({"--accelerator", "local-ibm"});
auto future2 = qcor::submit(
[
&
](
qcor::qpu_handler
&qh) {
int
main
(
int
argc
,
char
**
argv
)
{
xacc
::
Initialize
(
argc
,
argv
);
auto
future
=
qcor
::
submit
([
&
](
qcor
::
qpu_handler
&
qh
)
{
qh
.
execute
([
&
]()
{
H
(
0
);
CX
(
0
,
1
);
...
...
@@ -35,9 +37,9 @@ int main() {
});
});
auto results = future
2
.get();
auto
results
=
future
.
get
();
results
->
print
();
printf("
\n
");
}
\ No newline at end of file
}
```
\ No newline at end of file
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