Skip to content

Commit 6dc1e2a

Browse files
committed
Merge branch 'master' into remove_putblock_force
2 parents 38bbd29 + 07ba4c5 commit 6dc1e2a

File tree

133 files changed

+2669
-9600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+2669
-9600
lines changed

.github/workflows/conda_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [ubuntu-latest, macos-13, macos-latest]
19+
os: [ubuntu-latest, macos-15-intel, macos-latest]
2020
defaults:
2121
run:
2222
shell: bash -l {0}

.github/workflows/conda_build_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest, macos-13, macos-latest]
16+
os: [ubuntu-latest, macos-15-intel, macos-latest]
1717

1818
steps:
1919
- uses: actions/checkout@v4

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,14 @@ endif()
317317
# #######
318318
IF(BUILD_PYTHON)
319319
find_package (Python COMPONENTS Interpreter Development)
320-
find_package(pybind11 REQUIRED)
320+
find_package(pybind11 3.0.0 QUIET)
321321

322322
if(NOT pybind11_FOUND)
323323
include(FetchContent)
324324
FetchContent_Declare(
325325
pybind11_sources
326326
GIT_REPOSITORY https://github.com/pybind/pybind11.git
327-
GIT_TAG v2.11.1
327+
GIT_TAG v3.0.1
328328
)
329329

330330
FetchContent_GetProperties(pybind11_sources)

CytnxBKNDCMakeLists.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,33 @@ if(USE_CUDA)
126126
# -gencode=arch=compute_75,code=compute_75 ")
127127
target_compile_definitions(cytnx PUBLIC UNI_GPU)
128128
target_include_directories(cytnx PRIVATE ${CUDAToolkit_INCLUDE_DIRS})
129+
# CUDA 12+/13 may place Thrust/CUB headers under include/cccl.
130+
set(_cytnx_cccl_candidates)
131+
if(DEFINED CUDAToolkit_TARGET_DIR AND NOT "${CUDAToolkit_TARGET_DIR}" STREQUAL "")
132+
list(APPEND _cytnx_cccl_candidates "${CUDAToolkit_TARGET_DIR}/include/cccl")
133+
endif()
134+
foreach(_cuda_inc IN LISTS CUDAToolkit_INCLUDE_DIRS)
135+
list(APPEND _cytnx_cccl_candidates
136+
"${_cuda_inc}/cccl"
137+
"${_cuda_inc}/../include/cccl"
138+
"${_cuda_inc}/../../include/cccl"
139+
"${_cuda_inc}/../../../include/cccl")
140+
endforeach()
141+
list(REMOVE_DUPLICATES _cytnx_cccl_candidates)
142+
143+
set(_cytnx_cccl_dir "")
144+
foreach(_cccl_candidate IN LISTS _cytnx_cccl_candidates)
145+
get_filename_component(_cccl_candidate_abs "${_cccl_candidate}" ABSOLUTE)
146+
if(EXISTS "${_cccl_candidate_abs}")
147+
set(_cytnx_cccl_dir "${_cccl_candidate_abs}")
148+
break()
149+
endif()
150+
endforeach()
151+
if(NOT "${_cytnx_cccl_dir}" STREQUAL "")
152+
target_include_directories(cytnx PRIVATE "${_cytnx_cccl_dir}")
153+
message(STATUS "Detected CCCL headers at: ${_cytnx_cccl_dir}")
154+
endif()
155+
129156
target_link_libraries(cytnx PUBLIC CUDA::toolkit)
130157
target_link_libraries(cytnx PUBLIC CUDA::cudart CUDA::cublas CUDA::cusparse CUDA::curand CUDA::cusolver)
131158
target_link_libraries(cytnx PUBLIC -lcudadevrt)

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ Tensor A({3,4,5},Type.Double);
153153
UniTensor tA = UniTensor(A); // convert directly.
154154
UniTensor tB = UniTensor({Bond(3),Bond(4),Bond(5)},{}); // init from scratch.
155155
// Relabel the tensor and then contract.
156-
tA.relabels_({"common_1", "common_2", "out_a"});
157-
tB.relabels_({"common_1", "common_2", "out_b"});
156+
tA.relabel_({"common_1", "common_2", "out_a"});
157+
tB.relabel_({"common_1", "common_2", "out_b"});
158158
UniTensor out = cytnx::Contract(tA,tB);
159159
tA.print_diagram();
160160
tB.print_diagram();

benchmarks/linalg/Arnoldi_bm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace BMTest_Arnoldi {
1111
const unsigned int& dtype = Type.Double, const int& device = Device.cpu);
1212
UniTensor matvec(const UniTensor& l) override {
1313
auto tmp = Contracts({A, l, B}, "", true);
14-
tmp.relabels_(l.labels()).set_rowrank(l.rowrank());
14+
tmp.relabel_(l.labels()).set_rowrank(l.rowrank());
1515
return tmp;
1616
}
1717
};
@@ -22,15 +22,15 @@ namespace BMTest_Arnoldi {
2222
std::vector<Bond> bonds = {Bond(D), Bond(d), Bond(D)};
2323
A = UniTensor(bonds, {}, -1, in_dtype, in_device)
2424
.set_name("A")
25-
.relabels_({"al", "phys", "ar"})
25+
.relabel_({"al", "phys", "ar"})
2626
.set_rowrank(2);
2727
B = UniTensor(bonds, {}, -1, in_dtype, in_device)
2828
.set_name("B")
29-
.relabels_({"bl", "phys", "br"})
29+
.relabel_({"bl", "phys", "br"})
3030
.set_rowrank(2);
3131
T_init = UniTensor({Bond(D), Bond(D)}, {}, -1, in_dtype, in_device)
3232
.set_name("l")
33-
.relabels_({"al", "bl"})
33+
.relabel_({"al", "bl"})
3434
.set_rowrank(1);
3535
if (Type.is_float(this->dtype())) {
3636
double low = -1.0, high = 1.0;

benchmarks/linalg/Lanczos_bm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace BMTest_Lanczos {
2727
* | | + | | "pi"
2828
* |_|--"vol" "po" "vor"--|_|
2929
*
30-
* Then relabels ["vil", "pi", "vir"] -> ["vol", "po", "vor"]
30+
* Then relabel ["vil", "pi", "vir"] -> ["vol", "po", "vor"]
3131
*
3232
* "vil":virtual in bond left
3333
* "po":physical out bond

benchmarks/linalg/Svd_bm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace BMTest_Svd {
5151
auto UT = UniTensor(bonds, labels, row_rank, dtype, device, is_diag);
5252
double low = -1000, high = 1000;
5353
int rnd_seed = 0;
54-
random::Make_uniform(UT, low = -1000, high = 1000, rnd_seed);
54+
random::uniform_(UT, low = -1000, high = 1000, rnd_seed);
5555
return UT;
5656
}
5757

@@ -122,7 +122,7 @@ namespace BMTest_Svd {
122122
auto UT = UniTensor(bonds, labels, row_rank, dtype, Device.cpu, is_diag = false);
123123
double l_bd, h_bd;
124124
int rnd_seed;
125-
random::Make_uniform(UT, l_bd = -1000, h_bd = 1000, rnd_seed);
125+
random::uniform_(UT, l_bd = -1000, h_bd = 1000, rnd_seed);
126126
return UT;
127127
}
128128
static void BM_bkUT_U1_Svd_F64(benchmark::State& state) {

benchmarks/linalg/Svd_truncate_bm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace BMTest_Svd_truncate {
1717
auto UT = UniTensor(bonds, labels, row_rank, dtype, device, is_diag);
1818
double low = -1000, high = 1000;
1919
int rnd_seed = 0;
20-
random::Make_uniform(UT, low = -1000, high = 1000, rnd_seed);
20+
random::uniform_(UT, low = -1000, high = 1000, rnd_seed);
2121
return UT;
2222
}
2323

@@ -88,7 +88,7 @@ namespace BMTest_Svd_truncate {
8888
auto UT = UniTensor(bonds, labels, row_rank, dtype, Device.cpu, is_diag = false);
8989
double l_bd, h_bd;
9090
int rnd_seed;
91-
random::Make_uniform(UT, l_bd = -1000, h_bd = 1000, rnd_seed);
91+
random::uniform_(UT, l_bd = -1000, h_bd = 1000, rnd_seed);
9292
return UT;
9393
}
9494

developer_tools/dev_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# uT = cytnx.UniTensor.arange(2*3*4, name="tensor uT")
99
# uT.reshape_(2,3,4);
10-
# uT.relabels_(["a","b","c"])
10+
# uT.relabel_(["a","b","c"])
1111

1212
# T = cytnx.random.uniform([4,4], low=-1., high=1.)
1313
# print(T)

0 commit comments

Comments
 (0)