Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Default build options
build --copt -std=c++11
build --copt -D_GLIBCXX_USE_CXX11_ABI=0
build --copt -std=c++17
build --copt -D_GLIBCXX_USE_CXX11_ABI=1
build --experimental_repo_remote_exec

##### Sanitizers (choose one, or nosan for none) #####

Expand Down Expand Up @@ -55,3 +56,7 @@ build:malloc --

# Test flags
test --test_output=errors

# CUDA options
build:cuda --@local_config_cuda//:enable_cuda
build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.1.0
23 changes: 16 additions & 7 deletions .github/workflows/bazeltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

jobs:
# Run tests with Bazel v0.26.
# Run tests with Bazel v5.3.0.
test:
name: Test with Bazel
runs-on: ubuntu-20.04
Expand All @@ -26,8 +26,11 @@ jobs:
run: git submodule update --init --recursive
- name: Install Bazel on CI
run: |
wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel_3.7.2-linux-x86_64.deb
sudo dpkg -i bazel_3.7.2-linux-x86_64.deb
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
- name: Run C++ tests
run: |
bazel test --config=${{ matrix.hardware_opt }} \
Expand All @@ -52,8 +55,11 @@ jobs:
run: git submodule update --init --recursive
- name: Install Bazel on CI
run: |
wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel_3.7.2-linux-x86_64.deb
sudo dpkg -i bazel_3.7.2-linux-x86_64.deb
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
- name: Run C++ tests
run: |
bazel test --config=avx --config=openmp \
Expand All @@ -69,8 +75,11 @@ jobs:
run: git submodule update --init --recursive
- name: Install Bazel on CI
run: |
wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel_3.7.2-linux-x86_64.deb
sudo dpkg -i bazel_3.7.2-linux-x86_64.deb
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
- name: Install google-perftools for tcmalloc
run: sudo apt-get install libgoogle-perftools-dev
- name: Run C++ tests
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
- name: Install cibuildwheel and twine
run: python -m pip install cibuildwheel==2.2.2

- name: Install requirements
run: python -m pip install -r requirements.txt

- name: Run C++ tests
run: bash build_tools/test_libs.sh

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/testing_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
- name: Install cibuildwheel and twine
run: python -m pip install cibuildwheel==2.2.2

- name: Install requirements
run: python -m pip install -r requirements.txt

- name: Run C++ tests
run: bash build_tools/test_libs.sh

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ bazel-*

# Eigen library
eigen

# vscode
.vscode/*

# Bazel files
/bazel-*
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EIGEN_PREFIX = "d10b27fe37736d2944630ecd7557cefa95cf87c9"
EIGEN_PREFIX = "3bb6a48d8c171cf20b5f8e48bfb4e424fbd4f79e"
EIGEN_URL = "https://gitlab.com/libeigen/eigen/-/archive/"

TARGETS = qsim
Expand Down
26 changes: 21 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,32 @@ http_archive(
# https://github.com/tensorflow/quantum
http_archive(
name = "org_tensorflow",
sha256 = "e82f3b94d863e223881678406faa5071b895e1ff928ba18578d2adbbc6b42a4c",
strip_prefix = "tensorflow-2.1.0",
sha256 = "e52cda3bae45f0ae0fccd4055e9fa29892b414f70e2df94df9a3a10319c75fff",
strip_prefix = "tensorflow-2.11.0",
urls = [
"https://github.com/tensorflow/tensorflow/archive/v2.1.0.zip",
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.11.0.zip",
],
)

load("@org_tensorflow//tensorflow:workspace3.bzl", "workspace")

EIGEN_COMMIT = "12e8d57108c50d8a63605c6eb0144c838c128337"
EIGEN_SHA256 = "f689246e342c3955af48d26ce74ac34d21b579a00675c341721a735937919b02"
workspace()

load("@org_tensorflow//tensorflow:workspace2.bzl", "workspace")

workspace()

load("@org_tensorflow//tensorflow:workspace1.bzl", "workspace")

workspace()

load("@org_tensorflow//tensorflow:workspace0.bzl", "workspace")

workspace()


EIGEN_COMMIT = "3bb6a48d8c171cf20b5f8e48bfb4e424fbd4f79e"
EIGEN_SHA256 = "eca9847b3fe6249e0234a342b78f73feec07d29f534e914ba5f920f3e09383a3"


http_archive(
Expand Down
2 changes: 1 addition & 1 deletion build_tools/test_libs.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi
set e # Ignore errors until artifacts are collected.
EXIT_CODE=0
for TARGET in bitstring_test channels_cirq_test circuit_qsim_parser_test expect_test \
fuser_basic_test gates_qsim_test hybrid_test matrix_test qtrajectory_test \
fuser_basic_test gates_qsim_test hybrid_avx_test matrix_test qtrajectory_avx_test \
run_qsim_test run_qsimh_test simulator_basic_test simulator_sse_test statespace_basic_test \
statespace_sse_test unitary_calculator_basic_test unitary_calculator_sse_test \
unitaryspace_basic_test unitaryspace_sse_test vectorspace_test; do \
Expand Down
17 changes: 7 additions & 10 deletions lib/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@local_config_cuda//cuda:build_defs.bzl", "cuda_library")

package(default_visibility = ["//visibility:public"])

# Libraries of the following form:
Expand Down Expand Up @@ -67,8 +69,7 @@ cc_library(
)

# Full qsim library, including CUDA
# cuda_library
cc_library(
cuda_library(
name = "qsim_cuda_lib",
hdrs = [
"bits.h",
Expand Down Expand Up @@ -247,8 +248,7 @@ cc_library(
hdrs = ["util_cpu.h"],
)

# cuda_library
cc_library(
cuda_library(
name = "util_cuda",
hdrs = ["util_cuda.h"],
)
Expand Down Expand Up @@ -408,8 +408,7 @@ cc_library(
hdrs = ["vectorspace.h"],
)

# cuda_library
cc_library(
cuda_library(
name = "vectorspace_cuda",
hdrs = ["vectorspace_cuda.h"],
)
Expand Down Expand Up @@ -462,8 +461,7 @@ cc_library(
],
)

# cuda_library
cc_library(
cuda_library(
name = "statespace_cuda",
hdrs = [
"statespace_cuda.h",
Expand Down Expand Up @@ -520,8 +518,7 @@ cc_library(
],
)

# cuda_library
cc_library(
cuda_library(
name = "simulator_cuda",
hdrs = [
"simulator_cuda.h",
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PYBINDFLAGS_AVX2 = -mavx2 -mfma -Wall -shared -std=c++17 -fPIC `python3 -m pybin
PYBINDFLAGS_AVX512 = -mavx512f -mbmi2 -Wall -shared -std=c++17 -fPIC `python3 -m pybind11 --includes`

# The flags for the compilation of GPU-specific Pybind11 interfaces
PYBINDFLAGS_CUDA = -std=c++14 -x cu -Xcompiler "-Wall -shared -fPIC `python3 -m pybind11 --includes`"
PYBINDFLAGS_CUDA = -std=c++17 -x cu -Xcompiler "-Wall -shared -fPIC `python3 -m pybind11 --includes`"

# The flags for the compilation of cuStateVec-specific Pybind11 interfaces
PYBINDFLAGS_CUSTATEVEC = $(CUSTATEVECFLAGS) $(PYBINDFLAGS_CUDA)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
absl-py
cirq-core~=1.0
numpy~=1.16
numpy==1.21.1
pybind11
typing_extensions
4 changes: 2 additions & 2 deletions tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ sse_copts = ['-msse4']

windows_copts = [
"/arch:AVX",
"/std:c++14",
"/std:c++17",
]

windows_avx512_copts = [
"/arch:AVX512",
"/std:c++14",
"/std:c++17",
]

config_setting(
Expand Down