Skip to content
GitLab
Menu
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
258d050d
Commit
258d050d
authored
May 18, 2020
by
WrathfulSpatula
Browse files
Qrack plugin: remove redundant casts, fix white space, move CL_HPP defines to QrackVisitor.hpp
Signed-off-by:
WrathfulSpatula
<
stranoj@gmail.com
>
parent
c118f666
Changes
5
Hide whitespace changes
Inline
Side-by-side
quantum/plugins/CMakeLists.txt
View file @
258d050d
...
...
@@ -35,3 +35,4 @@ else()
endif
()
add_subdirectory
(
optimal_control
)
quantum/plugins/qrack/CMakeLists.txt
View file @
258d050d
...
...
@@ -15,8 +15,6 @@ target_include_directories(${LIBRARY_NAME}
./accelerator/src/include
${
CMAKE_SOURCE_DIR
}
/tpls/eigen
)
set
(
_bundle_name xacc_qrack
)
find_package
(
OpenCL
)
if
(
OpenCL_FOUND
)
target_link_libraries
(
${
LIBRARY_NAME
}
...
...
@@ -25,26 +23,22 @@ if (OpenCL_FOUND)
qrack
OpenCL
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES COMPILE_DEFINITIONS
US_BUNDLE_NAME=
${
_bundle_name
}
US_BUNDLE_NAME
${
_bundle_name
}
CL_HPP_TARGET_OPENCL_VERSION=200
CL_HPP_MINIMUM_OPENCL_VERSION=100
)
else
()
target_link_libraries
(
${
LIBRARY_NAME
}
PUBLIC xacc
xacc-quantum-gate
qrack
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES COMPILE_DEFINITIONS
US_BUNDLE_NAME=
${
_bundle_name
}
US_BUNDLE_NAME
${
_bundle_name
}
)
endif
()
set
(
_bundle_name xacc_qrack
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES COMPILE_DEFINITIONS
US_BUNDLE_NAME=
${
_bundle_name
}
US_BUNDLE_NAME
${
_bundle_name
}
)
usfunctionembedresources
(
TARGET
${
LIBRARY_NAME
}
WORKING_DIRECTORY
...
...
quantum/plugins/qrack/accelerator/QrackVisitor.cpp
View file @
258d050d
...
...
@@ -117,19 +117,19 @@ namespace quantum {
void
QrackVisitor
::
visit
(
Rz
&
rz
)
{
const
auto
angleTheta
=
InstructionParameterToDouble
(
rz
.
getParameter
(
0
));
m_qReg
->
RZ
(
(
Qrack
::
real1
)
angleTheta
,
rz
.
bits
()[
0
]);
m_qReg
->
RZ
(
angleTheta
,
rz
.
bits
()[
0
]);
}
void
QrackVisitor
::
visit
(
Ry
&
ry
)
{
const
auto
angleTheta
=
InstructionParameterToDouble
(
ry
.
getParameter
(
0
));
m_qReg
->
RY
(
(
Qrack
::
real1
)
angleTheta
,
ry
.
bits
()[
0
]);
m_qReg
->
RY
(
angleTheta
,
ry
.
bits
()[
0
]);
}
void
QrackVisitor
::
visit
(
Rx
&
rx
)
{
const
auto
angleTheta
=
InstructionParameterToDouble
(
rx
.
getParameter
(
0
));
m_qReg
->
RX
(
(
Qrack
::
real1
)
angleTheta
,
rx
.
bits
()[
0
]);
m_qReg
->
RX
(
angleTheta
,
rx
.
bits
()[
0
]);
}
void
QrackVisitor
::
visit
(
X
&
x
)
...
...
@@ -208,7 +208,7 @@ namespace quantum {
const
auto
theta
=
InstructionParameterToDouble
(
u
.
getParameter
(
0
));
const
auto
phi
=
InstructionParameterToDouble
(
u
.
getParameter
(
1
));
const
auto
lambda
=
InstructionParameterToDouble
(
u
.
getParameter
(
2
));
m_qReg
->
U
(
u
.
bits
()[
0
],
(
Qrack
::
real1
)
theta
,
(
Qrack
::
real1
)
phi
,
(
Qrack
::
real1
)
lambda
);
m_qReg
->
U
(
u
.
bits
()[
0
],
theta
,
phi
,
lambda
);
}
void
QrackVisitor
::
visit
(
iSwap
&
in_iSwapGate
)
...
...
quantum/plugins/qrack/accelerator/QrackVisitor.hpp
View file @
258d050d
...
...
@@ -17,6 +17,10 @@
#include "AllGateVisitor.hpp"
#include "AcceleratorBuffer.hpp"
#include "OptionsProvider.hpp"
#define CL_HPP_TARGET_OPENCL_VERSION 200
#define CL_HPP_MINIMUM_OPENCL_VERSION 100
#include "qrack/qfactory.hpp"
using
namespace
xacc
;
...
...
quantum/plugins/qrack/tests/CMakeLists.txt
View file @
258d050d
...
...
@@ -14,8 +14,3 @@
add_xacc_test
(
QrackAccelerator
)
target_link_libraries
(
QrackAcceleratorTester xacc-qrack
)
find_package
(
OpenCL
)
if
(
OpenCL_FOUND
)
target_compile_definitions
(
QrackAcceleratorTester PUBLIC CL_HPP_TARGET_OPENCL_VERSION=200
)
target_compile_definitions
(
QrackAcceleratorTester PUBLIC CL_HPP_MINIMUM_OPENCL_VERSION=100
)
endif
()
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