Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
1732d3c4
Commit
1732d3c4
authored
Jun 08, 2019
by
Mccaskey, Alex
Browse files
added accelerator:backend parsing to xacc::getAccelerator()
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
078aaa04
Pipeline
#58974
passed with stages
in 10 minutes and 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
xacc/XACC.cpp
View file @
1732d3c4
...
...
@@ -191,7 +191,13 @@ std::shared_ptr<Accelerator> getAccelerator(const std::string &name, std::shared
error
(
"XACC not initialized before use. Please execute "
"xacc::Initialize() before using API."
);
}
auto
acc
=
xacc
::
getService
<
Accelerator
>
(
name
);
auto
name_backend
=
split
(
name
,
':'
);
auto
acc
=
xacc
::
getService
<
Accelerator
>
(
name_backend
[
0
]);
if
(
name_backend
.
size
()
>
1
)
{
setOption
(
name_backend
[
0
]
+
"-backend"
,
name_backend
[
1
]);
}
if
(
acc
)
{
auto
remoteacc
=
std
::
dynamic_pointer_cast
<
RemoteAccelerator
>
(
acc
);
if
(
remoteacc
)
{
...
...
@@ -210,7 +216,12 @@ std::shared_ptr<Accelerator> getAccelerator(const std::string &name) {
error
(
"XACC not initialized before use. Please execute "
"xacc::Initialize() before using API."
);
}
auto
acc
=
xacc
::
getService
<
Accelerator
>
(
name
);
auto
name_backend
=
split
(
name
,
':'
);
auto
acc
=
xacc
::
getService
<
Accelerator
>
(
name_backend
[
0
]);
if
(
name_backend
.
size
()
>
1
)
{
setOption
(
name_backend
[
0
]
+
"-backend"
,
name_backend
[
1
]);
}
if
(
acc
)
{
acc
->
initialize
();
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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