Skip to content

Commit 4bf28d0

Browse files
author
xinpin
committed
Add NEON simulator and statespace headers
1 parent 70ecfd2 commit 4bf28d0

4 files changed

Lines changed: 1408 additions & 1 deletion

File tree

lib/BUILD

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ cc_library(
5555
"simulator_avx.h",
5656
"simulator_avx512.h",
5757
"simulator_basic.h",
58+
"simulator_neon.h",
5859
"simulator_sse.h",
5960
"statespace.h",
6061
"statespace_avx.h",
6162
"statespace_avx512.h",
6263
"statespace_basic.h",
64+
"statespace_neon.h",
6365
"statespace_sse.h",
6466
"umux.h",
6567
"unitary_calculator_avx.h",
@@ -130,13 +132,15 @@ cuda_library(
130132
"simulator_basic.h",
131133
"simulator_cuda.h",
132134
"simulator_cuda_kernels.h",
135+
"simulator_neon.h",
133136
"simulator_sse.h",
134137
"statespace.h",
135138
"statespace_avx.h",
136139
"statespace_avx512.h",
137140
"statespace_basic.h",
138141
"statespace_cuda.h",
139142
"statespace_cuda_kernels.h",
143+
"statespace_neon.h",
140144
"statespace_sse.h",
141145
"umux.h",
142146
"unitary_calculator_avx.h",
@@ -201,13 +205,15 @@ cuda_library(
201205
"simulator_basic.h",
202206
"simulator_custatevec.h",
203207
"simulator_custatevecex.h",
208+
"simulator_neon.h",
204209
"simulator_sse.h",
205210
"statespace.h",
206211
"statespace_avx.h",
207212
"statespace_avx512.h",
208213
"statespace_basic.h",
209214
"statespace_custatevec.h",
210215
"statespace_custatevecex.h",
216+
"statespace_neon.h",
211217
"statespace_sse.h",
212218
"umux.h",
213219
"unitary_calculator_avx.h",
@@ -602,6 +608,16 @@ cc_library(
602608
],
603609
)
604610

611+
cc_library(
612+
name = "statespace_neon",
613+
hdrs = ["statespace_neon.h"],
614+
deps = [
615+
":statespace",
616+
":util",
617+
":vectorspace",
618+
],
619+
)
620+
605621
cc_library(
606622
name = "statespace_sse",
607623
hdrs = ["statespace_sse.h"],
@@ -686,6 +702,17 @@ cc_library(
686702
],
687703
)
688704

705+
cc_library(
706+
name = "simulator_neon",
707+
hdrs = ["simulator_neon.h"],
708+
deps = [
709+
":simulator_base",
710+
":simulator_basic",
711+
":statespace_basic",
712+
":statespace_neon",
713+
],
714+
)
715+
689716
cc_library(
690717
name = "simulator_sse",
691718
hdrs = ["simulator_sse.h"],
@@ -741,6 +768,7 @@ cc_library(
741768
":simulator_avx",
742769
":simulator_avx512",
743770
":simulator_basic",
771+
":simulator_neon",
744772
":simulator_sse",
745773
],
746774
)

lib/simmux.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
#ifndef SIMMUX_H_
1616
#define SIMMUX_H_
1717

18-
#ifdef __AVX512F__
18+
#if defined(__ARM_NEON__) || defined(__ARM_NEON)
19+
# include "simulator_neon.h"
20+
namespace qsim {
21+
template <typename For>
22+
using Simulator = SimulatorNEON<For>;
23+
}
24+
#elif defined(__AVX512F__)
1925
# include "simulator_avx512.h"
2026
namespace qsim {
2127
template <typename For>

0 commit comments

Comments
 (0)