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
0da8c397
Commit
0da8c397
authored
Mar 24, 2019
by
Mccaskey, Alex
Browse files
Update README.md
parent
4b44bef5
Pipeline
#43513
passed with stages
in 2 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
compiler/clang/README.md
View file @
0da8c397
...
...
@@ -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