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
9cb8998b
Commit
9cb8998b
authored
Jul 10, 2019
by
Mccaskey, Alex
Browse files
adding xacc::qalloc() to public api
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
64bb5f77
Pipeline
#62723
passed with stages
in 10 minutes and 43 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
9cb8998b
...
...
@@ -23,6 +23,7 @@ if (FROM_SETUP_PY AND NOT APPLE)
set
(
CMAKE_SHARED_LINKER_FLAGS
"-static-libstdc++"
CACHE INTERNAL
""
FORCE
)
endif
()
set
(
CMAKE_DEBUG_POSTFIX
""
)
set
(
CMAKE_SKIP_INSTALL_RPATH OFF
)
set
(
CMAKE_SKIP_RPATH OFF
)
set
(
CMAKE_INSTALL_RPATH_USE_LINK_PATH ON
)
...
...
tools/compiler/clang/xacc_runtime.hpp
View file @
9cb8998b
...
...
@@ -6,12 +6,6 @@
#define __qpu__ __attribute__((annotate("__qpu__")))
#define __observe__(OBS) __attribute__((annotate("observe_" #OBS)))
using
qbit
=
std
::
shared_ptr
<
xacc
::
AcceleratorBuffer
>
;
namespace
xacc
{
qbit
qalloc
(
const
int
n
)
{
return
std
::
make_shared
<
xacc
::
AcceleratorBuffer
>
(
n
);
}
std
::
shared_ptr
<
Function
>
loadFromIR
(
const
std
::
string
&
ir
)
{
auto
function
=
xacc
::
getService
<
xacc
::
IRProvider
>
(
"gate"
)
->
createFunction
(
"f"
,
{},
{});
...
...
xacc/XACC.cpp
View file @
9cb8998b
...
...
@@ -125,6 +125,11 @@ void error(const std::string &msg, MessagePredicate predicate) {
}
}
qbit
qalloc
(
const
int
n
)
{
return
std
::
make_shared
<
xacc
::
AcceleratorBuffer
>
(
n
);
}
void
addCommandLineOption
(
const
std
::
string
&
optionName
,
const
std
::
string
&
optionDescription
)
{
xaccCLParser
->
addStringOption
(
optionName
,
optionDescription
);
...
...
xacc/XACC.hpp
View file @
9cb8998b
...
...
@@ -15,6 +15,7 @@
#include
"Compiler.hpp"
#include
"RemoteAccelerator.hpp"
// #include "AcceleratorBuffer.hpp"
namespace
xacc
{
...
...
@@ -237,6 +238,10 @@ std::shared_ptr<Compiler> getCompiler(const std::string &name);
*/
std
::
shared_ptr
<
Compiler
>
getCompiler
();
using
qbit
=
std
::
shared_ptr
<
xacc
::
AcceleratorBuffer
>
;
qbit
qalloc
(
const
int
n
);
/**
* Return true if the framework has a Compiler
* with the given name.
...
...
xacc/accelerator/AcceleratorBuffer.cpp
View file @
9cb8998b
...
...
@@ -496,7 +496,7 @@ void AcceleratorBuffer::load(std::istream &stream) {
std
::
string
json
(
std
::
istreambuf_iterator
<
char
>
(
stream
),
{});
Document
doc
;
doc
.
Parse
(
json
);
std
::
cout
<<
"HELLO
\n
"
<<
json
<<
"
\n
"
;
resetBuffer
();
if
(
!
cacheFile
)
{
...
...
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