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
b52c27aa
Commit
b52c27aa
authored
Feb 15, 2018
by
Mccaskey, Alex
Browse files
Updating api to fix clang warnings
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
18f3fa60
Changes
1
Hide whitespace changes
Inline
Side-by-side
xacc/XACC.cpp
View file @
b52c27aa
...
...
@@ -161,15 +161,16 @@ std::shared_ptr<Accelerator> getAccelerator() {
error
(
"Invalid use of XACC API. getAccelerator() with no string argument "
"requires that you set --accelerator at the command line."
);
}
auto
acc
=
ServiceRegistry
::
instance
()
->
getService
<
Accelerator
>
(
getOption
(
"accelerator"
));
if
(
acc
)
{
acc
->
initialize
();
return
acc
;
}
else
{
error
(
"Invalid Accelerator. Could not find "
+
getOption
(
"accelerator"
)
+
" in Accelerator Registry."
);
}
return
acc
;
}
std
::
shared_ptr
<
Accelerator
>
getAccelerator
(
const
std
::
string
&
name
)
{
...
...
@@ -181,12 +182,12 @@ std::shared_ptr<Accelerator> getAccelerator(const std::string& name) {
auto
acc
=
ServiceRegistry
::
instance
()
->
getService
<
Accelerator
>
(
name
);
if
(
acc
)
{
acc
->
initialize
();
return
acc
;
}
else
{
error
(
"Invalid Accelerator. Could not find "
+
name
+
" in Accelerator Registry."
);
}
return
acc
;
}
bool
hasAccelerator
(
const
std
::
string
&
name
)
{
...
...
@@ -206,13 +207,12 @@ std::shared_ptr<Compiler> getCompiler(const std::string& name) {
"xacc::Initialize() before using API."
);
}
auto
c
=
ServiceRegistry
::
instance
()
->
getService
<
Compiler
>
(
name
);
if
(
c
)
{
return
c
;
}
else
{
if
(
!
c
)
{
error
(
"Invalid Compiler. Could not find "
+
name
+
" in Service Registry."
);
}
return
c
;
}
std
::
shared_ptr
<
Compiler
>
getCompiler
()
{
...
...
@@ -227,13 +227,12 @@ std::shared_ptr<Compiler> getCompiler() {
"requires that you set --compiler at the command line."
);
}
auto
compiler
=
ServiceRegistry
::
instance
()
->
getService
<
Compiler
>
(
getOption
(
"compiler"
));
if
(
compiler
)
{
return
compiler
;
}
else
{
if
(
!
compiler
)
{
error
(
"Invalid Compiler. Could not find "
+
(
*
options
)[
"compiler"
]
+
" in Compiler Registry."
);
}
return
compiler
;
}
bool
hasCompiler
(
const
std
::
string
&
name
)
{
...
...
@@ -248,14 +247,13 @@ std::shared_ptr<IRTransformation> getIRTransformations(
"xacc::Initialize() before using API."
);
}
auto
t
=
ServiceRegistry
::
instance
()
->
getService
<
IRTransformation
>
(
name
);
if
(
t
)
{
return
t
;
}
else
{
if
(
!
t
)
{
error
(
"Invalid IRTransformation. Could not find "
+
name
+
" in Service Registry."
);
}
return
t
;
}
const
std
::
string
translate
(
const
std
::
string
&
original
,
const
std
::
string
&
originalLanguageName
,
...
...
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