Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ad2a928
refactor(vdw): make parameter table and XC iterator types explicit
Stardust0831 Nov 25, 2026
0274b21
test(vdw): spell out the owning solver type in factory tests
Stardust0831 Nov 25, 2026
ee353a8
refactor(nao): spell out radial orbital and coefficient types
Stardust0831 Nov 25, 2026
91eee86
refactor(base): spell out grid, transform and allocation types
Stardust0831 Nov 25, 2026
0302104
refactor(pw): spell out FFT scratch buffer pointer types
Stardust0831 Nov 25, 2026
7b74940
refactor(input): spell out container and element types in callbacks
Stardust0831 Nov 25, 2026
eeb15fb
refactor(pw): use the template real type for weights and lattice factors
Stardust0831 Nov 25, 2026
0b16fcc
refactor(base): name tensor values, buffers and clock results
Stardust0831 Nov 25, 2026
281dcd8
refactor(basis): name the pooled spherical Bessel reference type
Stardust0831 Nov 25, 2026
8b0102d
refactor(cell): name geometry and neighbour container elements
Stardust0831 Nov 25, 2026
f58be2d
refactor(psi): name wavefunction initializer pointers
Stardust0831 Nov 25, 2026
1a4573a
refactor(relax): name structure and matrix row types
Stardust0831 Nov 25, 2026
a62e053
refactor(io): make reader, writer and INPUT test declarations explicit
Stardust0831 Nov 25, 2026
72dd423
refactor(lcao): name orbital, matrix and linear-response values
Stardust0831 Nov 25, 2026
32d00e8
refactor(pw): spell out plane-wave buffer and grid types
Stardust0831 Nov 25, 2026
ea1c2e3
refactor(hamilt): name integration, kernel and projection values
Stardust0831 Nov 25, 2026
68efe9f
refactor(estate): give density and potential variables their declared…
Stardust0831 Nov 25, 2026
1d817e2
refactor(esolver): name solver helper and operator types
Stardust0831 Nov 25, 2026
d7bdf7e
refactor(hsolver): name solver values and test vectors
Stardust0831 Nov 25, 2026
47f3f9f
refactor(pyabacus): name arrays returned by the LCAO bindings
Stardust0831 Nov 25, 2026
6562484
refactor(lcao): name RI orbitals, response tensors and orbital indexes
Stardust0831 Nov 25, 2026
b5d5401
refactor(io): name response indexes and projector types
Stardust0831 Nov 25, 2026
703ef6b
refactor(pw): preserve device parameters in projector pointers
Stardust0831 Nov 25, 2026
f9e88ab
refactor(hamilt): name Libxc, grid and transfer values
Stardust0831 Nov 25, 2026
ef3d5db
refactor(esolver): name the LR response tensor
Stardust0831 Nov 25, 2026
c6aa004
refactor(hsolver): name tensor and tensor-map values
Stardust0831 Nov 25, 2026
fc49d4b
refactor(base): name CUDA tensor and memory kernel types
Stardust0831 Nov 25, 2026
ef04f7e
refactor(hamilt): name CUDA integration buffers and XC kernel pointers
Stardust0831 Nov 25, 2026
cb7c1f0
refactor(hsolver): name BPCG CUDA element and buffer types
Stardust0831 Nov 25, 2026
e49f04b
refactor(lcao): name orbitals and projectors in the CUDA RT kernel
Stardust0831 Nov 25, 2026
c85dbba
refactor(pw): name precision-dependent CUDA force and stress values
Stardust0831 Nov 25, 2026
00963ec
refactor(lcao): name values in instantiated response routines
Stardust0831 Nov 25, 2026
4386604
refactor(io): name checked header-local types
Stardust0831 Nov 25, 2026
26e70d9
refactor(base): name header-local values
Stardust0831 Nov 25, 2026
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
6 changes: 3 additions & 3 deletions python/pyabacus/src/ModuleESolver/py_esolver_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ py::array_t<double> PyChargeAccessor::get_rho() const
// Create numpy array with shape (nspin, nrxx)
std::vector<ssize_t> shape = {static_cast<ssize_t>(nspin_), static_cast<ssize_t>(nrxx_)};

auto result = py::array_t<double>(shape);
py::array_t<double> result = py::array_t<double>(shape);
auto buf = result.request();
double* ptr = static_cast<double*>(buf.ptr);

Expand Down Expand Up @@ -114,7 +114,7 @@ py::array_t<std::complex<double>> PyChargeAccessor::get_rhog() const
// Create numpy array with shape (nspin, ngmc)
std::vector<ssize_t> shape = {static_cast<ssize_t>(nspin_), static_cast<ssize_t>(ngmc_)};

auto result = py::array_t<std::complex<double>>(shape);
py::array_t<std::complex<double>> result = py::array_t<std::complex<double>>(shape);
auto buf = result.request();
std::complex<double>* ptr = static_cast<std::complex<double>*>(buf.ptr);

Expand All @@ -140,7 +140,7 @@ py::array_t<double> PyChargeAccessor::get_rho_core() const
// Create numpy array with shape (nrxx,)
std::vector<ssize_t> shape = {static_cast<ssize_t>(nrxx_)};

auto result = py::array_t<double>(shape);
py::array_t<double> result = py::array_t<double>(shape);
auto buf = result.request();
double* ptr = static_cast<double*>(buf.ptr);

Expand Down
2 changes: 1 addition & 1 deletion source/source_base/formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class FmtTable
const size_t ncols = data_.shape()[1];
// if not all titles are empty, then with_title boolean will be true
bool with_title = false;
for (auto& title: titles_) {
for (std::string& title: titles_) {
if (!title.empty()) {
with_title = true;
break;
Expand Down
18 changes: 9 additions & 9 deletions source/source_base/kernels/cuda/math_kernel_op_vec.cu
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ void vector_mul_vector_op<T, base_device::DEVICE_GPU, Operand>::operator()(const

using DeviceT = typename GetTypeThrust<T>::type;
using DeviceOperand = typename GetTypeThrust<Operand>::type;
auto result_tmp = reinterpret_cast<DeviceT*>(result);
auto vector1_tmp = reinterpret_cast<const DeviceT*>(vector1);
auto vector2_tmp = reinterpret_cast<const DeviceOperand*>(vector2);
DeviceT* result_tmp = reinterpret_cast<DeviceT*>(result);
const DeviceT* vector1_tmp = reinterpret_cast<const DeviceT*>(vector1);
const DeviceOperand* vector2_tmp = reinterpret_cast<const DeviceOperand*>(vector2);
const int thread = thread_per_block;
const int block = (dim + thread - 1) / thread;
vector_mul_vector_kernel<DeviceT, DeviceOperand>
Expand All @@ -239,9 +239,9 @@ void vector_div_vector_op<T, base_device::DEVICE_GPU, Operand>::operator()(const

using DeviceT = typename GetTypeThrust<T>::type;
using DeviceOperand = typename GetTypeThrust<Operand>::type;
auto result_tmp = reinterpret_cast<DeviceT*>(result);
auto vector1_tmp = reinterpret_cast<const DeviceT*>(vector1);
auto vector2_tmp = reinterpret_cast<const DeviceOperand*>(vector2);
DeviceT* result_tmp = reinterpret_cast<DeviceT*>(result);
const DeviceT* vector1_tmp = reinterpret_cast<const DeviceT*>(vector1);
const DeviceOperand* vector2_tmp = reinterpret_cast<const DeviceOperand*>(vector2);
const int thread = thread_per_block;
const int block = (dim + thread - 1) / thread;
vector_div_vector_kernel<DeviceT, DeviceOperand>
Expand All @@ -264,9 +264,9 @@ void vector_add_vector_op<T, base_device::DEVICE_GPU, Scalar>::operator()(const

using DeviceT = typename GetTypeThrust<T>::type;
using DeviceScalar = typename GetTypeThrust<Scalar>::type;
auto result_tmp = reinterpret_cast<DeviceT*>(result);
auto vector1_tmp = reinterpret_cast<const DeviceT*>(vector1);
auto vector2_tmp = reinterpret_cast<const DeviceT*>(vector2);
DeviceT* result_tmp = reinterpret_cast<DeviceT*>(result);
const DeviceT* vector1_tmp = reinterpret_cast<const DeviceT*>(vector1);
const DeviceT* vector2_tmp = reinterpret_cast<const DeviceT*>(vector2);
const DeviceScalar device_constant1 = to_device_value(constant1);
const DeviceScalar device_constant2 = to_device_value(constant2);
const int thread = thread_per_block;
Expand Down
2 changes: 1 addition & 1 deletion source/source_base/math_lebedev_laikov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace ModuleBase

Lebedev_laikov_grid::Lebedev_laikov_grid(int degree)
{
auto it = allowed_degree.find(degree);
std::set<int>::iterator it = allowed_degree.find(degree);
if (it == allowed_degree.end())
{
std::cerr << "In the Lebedev_laikov_grid class, the degree = " << degree << " is not within the allowed range."
Expand Down
4 changes: 2 additions & 2 deletions source/source_base/math_ylmreal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ void YlmReal::Ylm_Real
for (int i=0;i<ng;i++)
{
p(0,1,i) = cost[i];
auto x1 = 1.0 - cost[i] * cost[i];
double x1 = 1.0 - cost[i] * cost[i];
x1 = std::max(0.0, x1);
p(1,1,i) = -sqrt(x1);
}
Expand Down Expand Up @@ -495,7 +495,7 @@ void YlmReal::Ylm_Real
for (int i=0;i<ng;i++)
{
p(l1, l, i) = cost[i] * l3 * p(l1, l1, i);
auto x2 = 1.0 - cost[i] * cost[i];
double x2 = 1.0 - cost[i] * cost[i];
x2 = std::max(0.0, x2);
p(l, l, i) = Semi_Fact(l3) * pow(x2, static_cast<double>(l) / 2.0) ;//mohan modify 2007-10-13
if (l%2 == 1)
Expand Down
18 changes: 9 additions & 9 deletions source/source_base/module_container/ATen/core/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Tensor::reshape(TensorShape shape) {
int64_t num = 1;
int auto_shape = 0, dim_count = -1, dim_idx = -1;

for (auto dim : shape.dims()) {
for (int64_t dim : shape.dims()) {
dim_count++;
if (dim < 1 && dim != -1) {
throw std::invalid_argument("Invalid shape, dim of tensor must >= 1 or equal to -1(auto shape).");
Expand Down Expand Up @@ -321,7 +321,7 @@ Tensor Tensor::operator[](const int& index) const {
// If the output shape is empty, we need to add a dimension of size 1
output_shape.add_dim(1);
}
auto data_ = reinterpret_cast<char*>(this->data()) + index * shape_.strides()[0] * SizeOfType(this->data_type_);
char* data_ = reinterpret_cast<char*>(this->data()) + index * shape_.strides()[0] * SizeOfType(this->data_type_);

return TensorMap(data_, this->data_type_, this->device_, output_shape);
}
Expand All @@ -336,7 +336,7 @@ std::ostream& operator<<(std::ostream& os, const Tensor& tensor) {
const TensorShape& shape = tensor.shape();

// Copy the data from device to host for output
auto * data_ = tensor.data();
void* data_ = tensor.data();
#if __CUDA || __ROCM
if (device_type != DeviceType::CpuDevice) {
data_ = malloc(num_elements * Tensor::SizeOfType(data_type));
Expand All @@ -361,32 +361,32 @@ std::ostream& operator<<(std::ostream& os, const Tensor& tensor) {
os << ", buffer=\narray(";
switch (data_type) {
case DataType::DT_FLOAT: {
const auto* data = static_cast<const float*>(data_);
const float* data = static_cast<const float*>(data_);
_internal_output(os, data, shape, num_elements);
break;
}
case DataType::DT_DOUBLE: {
const auto* data = static_cast<const double*>(data_);
const double* data = static_cast<const double*>(data_);
_internal_output(os, data, shape, num_elements);
break;
}
case DataType::DT_INT: {
const auto* data = static_cast<const int*>(data_);
const int* data = static_cast<const int*>(data_);
_internal_output(os, data, shape, num_elements);
break;
}
case DataType::DT_INT64: {
const auto* data = static_cast<const int64_t*>(data_);
const int64_t* data = static_cast<const int64_t*>(data_);
_internal_output(os, data, shape, num_elements);
break;
}
case DataType::DT_COMPLEX: {
const auto* data = static_cast<const std::complex<float>*>(data_);
const std::complex<float>* data = static_cast<const std::complex<float>*>(data_);
_internal_output(os, data, shape, num_elements);
break;
}
case DataType::DT_COMPLEX_DOUBLE: {
const auto* data = static_cast<const std::complex<double>*>(data_);
const std::complex<double>* data = static_cast<const std::complex<double>*>(data_);
_internal_output(os, data, shape, num_elements);
break;
}
Expand Down
28 changes: 14 additions & 14 deletions source/source_base/module_container/ATen/kernels/cuda/linalg.cu
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static std::vector<T> compute_stride(const std::vector<T>& shape) {
std::vector<T> strides(ndims);
T stride = 1;

auto it = shape.end(); // Start from the last element
typename std::vector<T>::const_iterator it = shape.end(); // Start from the last element
for (int ii = ndims - 1; ii >= 0; ii--) {
it--;
strides[ii] = stride;
Expand All @@ -226,8 +226,8 @@ static std::vector<T> compute_stride(const std::vector<T>& shape) {
template<typename T, typename Device>
void add<T, Device>::operator()(const int& num_element, const T& alpha, const T* x, const T& beta, const T* y, T* z) {
using Type = typename GetTypeThrust<T>::type;
auto alpha_ = *reinterpret_cast<const Type*>(&alpha);
auto beta_ = *reinterpret_cast<const Type*>(&beta);
Type alpha_ = *reinterpret_cast<const Type*>(&alpha);
Type beta_ = *reinterpret_cast<const Type*>(&beta);
const int block = (num_element + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;
do_add_kernel<Type><<<block, THREADS_PER_BLOCK>>> (
num_element, alpha_, reinterpret_cast<const Type*>(x),
Expand All @@ -239,7 +239,7 @@ void add<T, Device>::operator()(const int& num_element, const T& alpha, const T*
template<typename T, typename Device>
void mul<T, Device>::operator()(const int& num_element, const T& alpha, const T* x, T* y) {
using Type = typename GetTypeThrust<T>::type;
auto alpha_ = *reinterpret_cast<const Type*>(&alpha);
Type alpha_ = *reinterpret_cast<const Type*>(&alpha);
const int block = (num_element + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;
do_mul_kernel<Type><<<block, THREADS_PER_BLOCK>>> (
num_element, alpha_,
Expand All @@ -251,7 +251,7 @@ void mul<T, Device>::operator()(const int& num_element, const T& alpha, const T*
template<typename T, typename Device>
void mul<T, Device>::operator()(const int& num_element, const T& alpha, const T* x, const T* y, T* z) {
using Type = typename GetTypeThrust<T>::type;
auto alpha_ = *reinterpret_cast<const Type*>(&alpha);
Type alpha_ = *reinterpret_cast<const Type*>(&alpha);
const int block = (num_element + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;
do_mul_kernel<Type><<<block, THREADS_PER_BLOCK>>> (
num_element, alpha_,
Expand All @@ -263,7 +263,7 @@ void mul<T, Device>::operator()(const int& num_element, const T& alpha, const T*
template<typename T, typename Device>
void div<T, Device>::operator()(const int& num_element, const T& alpha, const T* x, const T* y, T* z) {
using Type = typename GetTypeThrust<T>::type;
auto alpha_ = *reinterpret_cast<const Type*>(&alpha);
Type alpha_ = *reinterpret_cast<const Type*>(&alpha);
const int block = (num_element + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;
do_div_kernel<Type><<<block, THREADS_PER_BLOCK>>> (
num_element, alpha_, reinterpret_cast<const Type*>(x), reinterpret_cast<const Type*>(y), reinterpret_cast<Type*>(z));
Expand All @@ -274,8 +274,8 @@ void div<T, Device>::operator()(const int& num_element, const T& alpha, const T*
template<typename T, typename Device>
void fma<T, Device>::operator()(const int& num_element, const T& alpha, const T* x, const T* y, const T& beta, const T* z, T* out) {
using Type = typename GetTypeThrust<T>::type;
auto alpha_ = *reinterpret_cast<const Type*>(&alpha);
auto beta_ = *reinterpret_cast<const Type*>(&beta);
Type alpha_ = *reinterpret_cast<const Type*>(&alpha);
Type beta_ = *reinterpret_cast<const Type*>(&beta);
const int block = (num_element + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;
do_fma_kernel<Type><<<block, THREADS_PER_BLOCK>>> (
num_element, alpha_, reinterpret_cast<const Type*>(x), reinterpret_cast<const Type*>(y),
Expand All @@ -297,8 +297,8 @@ void transpose<T, Device, Conjugate>::operator()(
REQUIRES_OK(p_shape.size() == q_shape.size(),
"transpose: p and q must have the same number of dimensions");
const int ndim = static_cast<int>(p_shape.size());
auto in_strides = compute_stride(p_shape);
auto out_strides = compute_stride(q_shape);
std::vector<int64_t> in_strides = compute_stride(p_shape);
std::vector<int64_t> out_strides = compute_stride(q_shape);

int num_elements = 1;
for (int ii = 0; ii < ndim; ++ii) {
Expand Down Expand Up @@ -341,8 +341,8 @@ void stride<T, Device>::operator()(
REQUIRES_OK(p_shape.size() == q_shape.size(),
"transpose: p and q must have the same number of dimensions");
const int ndim = static_cast<int>(p_shape.size());
auto in_strides = compute_stride(p_shape);
auto out_strides = compute_stride(q_shape);
std::vector<int64_t> in_strides = compute_stride(p_shape);
std::vector<int64_t> out_strides = compute_stride(q_shape);

int num_elements = 1;
for (int ii = 0; ii < ndim; ++ii) {
Expand Down Expand Up @@ -385,8 +385,8 @@ void inflate<T, Device>::operator()(
REQUIRES_OK(p_shape.size() == q_shape.size(),
"transpose: p and q must have the same number of dimensions");
const int ndim = static_cast<int>(p_shape.size());
auto in_strides = compute_stride(p_shape);
auto out_strides = compute_stride(q_shape);
std::vector<int64_t> in_strides = compute_stride(p_shape);
std::vector<int64_t> out_strides = compute_stride(q_shape);

int num_elements = 1;
for (int ii = 0; ii < ndim; ++ii) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ __global__ void do_cast_memory(
{
unsigned int idx = blockIdx.x * blockDim.x + threadIdx.x;
if(idx >= size) {return;}
auto* _out = reinterpret_cast<thrust::complex<T_out>*>(out);
const auto* _in = reinterpret_cast<const thrust::complex<T_in>*>(in);
thrust::complex<T_out>* _out = reinterpret_cast<thrust::complex<T_out>*>(out);
const thrust::complex<T_in>* _in = reinterpret_cast<const thrust::complex<T_in>*>(in);
_out[idx] = static_cast<thrust::complex<T_out>>(_in[idx]);
}

Expand Down Expand Up @@ -138,7 +138,7 @@ struct cast_memory<T_out, T_in, container::DEVICE_CPU, container::DEVICE_GPU> {
const T_in* arr_in,
const size_t& size)
{
auto * arr = (T_in*) malloc(sizeof(T_in) * size);
T_in* arr = (T_in*) malloc(sizeof(T_in) * size);
CHECK_CUDA(cudaMemcpy(arr, arr_in, sizeof(T_in) * size, cudaMemcpyDeviceToHost));
for (int ii = 0; ii < size; ii++) {
arr_out[ii] = static_cast<T_out>(arr[ii]);
Expand Down
14 changes: 7 additions & 7 deletions source/source_base/module_container/ATen/kernels/linalg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static std::vector<T> ComputeStride(const std::vector<T>& shape) {
std::vector<T> strides(ndims);
T stride = 1;

auto it = shape.end(); // Start from the last element
typename std::vector<T>::const_iterator it = shape.end(); // Start from the last element
for (int ii = ndims - 1; ii >= 0; ii--) {
it--;
strides[ii] = stride;
Expand Down Expand Up @@ -89,8 +89,8 @@ void transpose<T, Device, Conjugate>::operator()(
REQUIRES_OK(p_shape.size() == q_shape.size(),
"transpose: p and q must have the same number of dimensions");
const int ndim = static_cast<int>(p_shape.size());
auto in_strides = ComputeStride(p_shape);
auto out_strides = ComputeStride(q_shape);
std::vector<int64_t> in_strides = ComputeStride(p_shape);
std::vector<int64_t> out_strides = ComputeStride(q_shape);

int64_t num_elements = 1;
for (int ii = 0; ii < ndim; ++ii) {
Expand Down Expand Up @@ -135,8 +135,8 @@ void stride<T, Device>::operator()(
REQUIRES_OK(p_shape.size() == q_shape.size() ,
"stride: p and q must match the number of dimensions");
const int ndim = static_cast<int>(p_shape.size());
auto in_strides = ComputeStride(p_shape);
auto out_strides = ComputeStride(q_shape);
std::vector<int64_t> in_strides = ComputeStride(p_shape);
std::vector<int64_t> out_strides = ComputeStride(q_shape);

int64_t num_elements = 1;
for (int ii = 0; ii < ndim; ++ii) {
Expand Down Expand Up @@ -176,8 +176,8 @@ void inflate<T, Device>::operator()(
REQUIRES_OK(p_shape.size() == q_shape.size(),
"transpose: p and q must have the same number of dimensions");
const int ndim = static_cast<int>(p_shape.size());
auto in_strides = ComputeStride(p_shape);
auto out_strides = ComputeStride(q_shape);
std::vector<int64_t> in_strides = ComputeStride(p_shape);
std::vector<int64_t> out_strides = ComputeStride(q_shape);

int64_t num_elements = 1;
for (int ii = 0; ii < ndim; ++ii) {
Expand Down
8 changes: 4 additions & 4 deletions source/source_base/module_container/ATen/ops/einsum_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void PermuteLabels(
const std::vector<int>& permutation,
std::vector<int>& labels)
{
auto num_labels = labels.size();
std::size_t num_labels = labels.size();
std::vector<int> permuted_labels(num_labels, 0);
for (int ii = 0; ii < num_labels; ii++) {
permuted_labels[ii] = labels[permutation[ii]];
Expand Down Expand Up @@ -462,7 +462,7 @@ bool ValidateEinsumEquation(

// Part 3: Check the "->" flag
std::vector<std::string> inputs_and_output_subscripts;
auto delimiter_pos = equation_no_space.find("->");
std::string::size_type delimiter_pos = equation_no_space.find("->");
if (delimiter_pos == std::string::npos) {
throw std::invalid_argument("No '->' in einsum equation: " + equation_no_space);
}
Expand All @@ -475,7 +475,7 @@ bool ValidateEinsumEquation(
output_subscript = std::move(inputs_and_output_subscripts[1]);

// Part 4: Address the comma in the input subscripts
auto comma_pos = inputs_and_output_subscripts[0].find(',');
std::string::size_type comma_pos = inputs_and_output_subscripts[0].find(',');
while (comma_pos != std::string::npos) {
input_subscripts.push_back(inputs_and_output_subscripts[0].substr(0, comma_pos));
inputs_and_output_subscripts[0] = inputs_and_output_subscripts[0].substr(comma_pos + 1);
Expand Down Expand Up @@ -575,7 +575,7 @@ bool ParseEinsumEquation(
bool RecordLabelToDimension(const int label, const int axis, const Tensor& input,
std::unordered_map<int, int64_t>& label_to_dim_sizes) {
const int64_t input_dim = input.shape().dim_size(axis);
auto& label_dim = label_to_dim_sizes[label];
int64_t& label_dim = label_to_dim_sizes[label];
if (label_dim != 0 && label_dim != input_dim) {
throw std::invalid_argument(
"Expected dimension " + std::to_string(label_to_dim_sizes[label]) + " at axis " +
Expand Down
8 changes: 4 additions & 4 deletions source/source_base/module_device/cuda/memory_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ __global__ void cast_memory(std::complex<FPTYPE_out>* out, const std::complex<FP
{
return;
}
auto* _out = reinterpret_cast<thrust::complex<FPTYPE_out>*>(out);
const auto* _in = reinterpret_cast<const thrust::complex<FPTYPE_in>*>(in);
thrust::complex<FPTYPE_out>* _out = reinterpret_cast<thrust::complex<FPTYPE_out>*>(out);
const thrust::complex<FPTYPE_in>* _in = reinterpret_cast<const thrust::complex<FPTYPE_in>*>(in);
_out[idx] = static_cast<thrust::complex<FPTYPE_out>>(_in[idx]);
}

Expand All @@ -47,7 +47,7 @@ __global__ void cast_memory(std::complex<FPTYPE_out>* out, const FPTYPE_in* in,
{
return;
}
auto* _out = reinterpret_cast<thrust::complex<FPTYPE_out>*>(out);
thrust::complex<FPTYPE_out>* _out = reinterpret_cast<thrust::complex<FPTYPE_out>*>(out);
_out[idx] = static_cast<thrust::complex<FPTYPE_out>>(in[idx]);
}

Expand Down Expand Up @@ -215,7 +215,7 @@ struct cast_memory_op<FPTYPE_out, FPTYPE_in, base_device::DEVICE_CPU, base_devic
size);
return;
}
auto * arr = (FPTYPE_in*) malloc(sizeof(FPTYPE_in) * size);
FPTYPE_in* arr = (FPTYPE_in*) malloc(sizeof(FPTYPE_in) * size);
CHECK_CUDA(cudaMemcpy(arr, arr_in, sizeof(FPTYPE_in) * size, cudaMemcpyDeviceToHost));
for (int ii = 0; ii < size; ii++) {
arr_out[ii] = static_cast<FPTYPE_out>(arr[ii]);
Expand Down
Loading
Loading