From bc16f202ca348ba8aefcc2357bf3d4969dd18859 Mon Sep 17 00:00:00 2001 From: Jae Yoo Date: Mon, 1 May 2023 10:43:06 -0700 Subject: [PATCH] Fix simmux_gpu.h compile error and config bzl rule error. --- lib/simmux_gpu.h | 4 ++-- third_party/cuquantum/cuquantum_configure.bzl | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/simmux_gpu.h b/lib/simmux_gpu.h index 9b08ac48..1f0bb592 100644 --- a/lib/simmux_gpu.h +++ b/lib/simmux_gpu.h @@ -18,12 +18,12 @@ #ifdef __CUSTATEVEC__ # include "simulator_custatevec.h" namespace qsim { - using SimulatorGpu = SimulatorCuStateVec; + using SimulatorGpu = SimulatorCuStateVec<>; } #else # include "simulator_cuda.h" namespace qsim { - using SimulatorGpu = SimulatorCUDA; + using SimulatorGpu = SimulatorCUDA<>; } #endif diff --git a/third_party/cuquantum/cuquantum_configure.bzl b/third_party/cuquantum/cuquantum_configure.bzl index d4846ad4..19feb557 100644 --- a/third_party/cuquantum/cuquantum_configure.bzl +++ b/third_party/cuquantum/cuquantum_configure.bzl @@ -196,7 +196,12 @@ def _symlink_genrule_for_dir( def _cuquantum_pip_impl(repository_ctx): - cuquantum_root = repository_ctx.os.environ[_CUQUANTUM_ROOT] + if _CUQUANTUM_ROOT in repository_ctx.os.environ: + cuquantum_root = repository_ctx.os.environ[_CUQUANTUM_ROOT] + else: + repository_ctx.os.environ[_CUQUANTUM_ROOT] = "" + cuquantum_root = "" + if cuquantum_root == "": cuquantum_header_path = _find_file(repository_ctx, "custatevec.h") cuquantum_header_path = cuquantum_header_path[:cuquantum_header_path.find("/custatevec.h")]