Skip to content

Commit 74e0c5b

Browse files
authored
Initial commit (#6708)
1 parent ec40f66 commit 74e0c5b

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

source/source_base/module_device/memory_op.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ struct resize_memory_op_mt<FPTYPE, base_device::DEVICE_CPU>
452452
{
453453
mtfunc::free_ht(arr);
454454
}
455-
arr = (FPTYPE*)mtfunc::malloc_ht(sizeof(FPTYPE) * size, GlobalV::MY_RANK);
455+
arr = (FPTYPE*)mtfunc::malloc_ht(sizeof(FPTYPE) * size, GlobalV::MY_RANK % 4);
456456
std::string record_string;
457457
if (record_in != nullptr)
458458
{

source/source_base/module_external/blas_connector_matrix.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void BlasConnector::gemm(const char transa, const char transb, const int m, cons
3030
else if (device_type == base_device::AbacusDevice_t::DspDevice){
3131
mtfunc::sgemm_mth_(&transb, &transa, &n, &m, &k,
3232
&alpha, b, &ldb, a, &lda,
33-
&beta, c, &ldc, GlobalV::MY_RANK);
33+
&beta, c, &ldc, GlobalV::MY_RANK % 4);
3434
}
3535
#endif
3636
#ifdef __CUDA
@@ -67,7 +67,7 @@ void BlasConnector::gemm(const char transa,
6767
#ifdef __DSP
6868
else if (device_type == base_device::AbacusDevice_t::DspDevice)
6969
{
70-
mtfunc::dgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK);
70+
mtfunc::dgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK % 4);
7171
}
7272
#endif
7373
else if (device_type == base_device::AbacusDevice_t::GpuDevice)
@@ -106,7 +106,7 @@ void BlasConnector::gemm(const char transa,
106106
#ifdef __DSP
107107
else if (device_type == base_device::AbacusDevice_t::DspDevice)
108108
{
109-
mtfunc::cgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK);
109+
mtfunc::cgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK % 4);
110110
}
111111
#endif
112112
else if (device_type == base_device::AbacusDevice_t::GpuDevice)
@@ -157,7 +157,7 @@ void BlasConnector::gemm(const char transa,
157157
#ifdef __DSP
158158
else if (device_type == base_device::AbacusDevice_t::DspDevice)
159159
{
160-
mtfunc::zgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK);
160+
mtfunc::zgemm_mth_(&transb, &transa, &n, &m, &k, &alpha, b, &ldb, a, &lda, &beta, c, &ldc, GlobalV::MY_RANK % 4);
161161
}
162162
#endif
163163
else if (device_type == base_device::AbacusDevice_t::GpuDevice)
@@ -200,7 +200,7 @@ void BlasConnector::gemm_cm(const char transa, const char transb, const int m, c
200200
else if (device_type == base_device::AbacusDevice_t::DspDevice){
201201
mtfunc::sgemm_mth_(&transb, &transa, &m, &n, &k,
202202
&alpha, a, &lda, b, &ldb,
203-
&beta, c, &ldc, GlobalV::MY_RANK);
203+
&beta, c, &ldc, GlobalV::MY_RANK % 4);
204204
}
205205
#endif
206206
#ifdef __CUDA
@@ -237,7 +237,7 @@ void BlasConnector::gemm_cm(const char transa,
237237
#ifdef __DSP
238238
else if (device_type == base_device::AbacusDevice_t::DspDevice)
239239
{
240-
mtfunc::dgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK);
240+
mtfunc::dgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK % 4);
241241
}
242242
#endif
243243
#ifdef __CUDA
@@ -276,7 +276,7 @@ void BlasConnector::gemm_cm(const char transa,
276276
#ifdef __DSP
277277
else if (device_type == base_device::AbacusDevice_t::DspDevice)
278278
{
279-
mtfunc::cgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK);
279+
mtfunc::cgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK % 4);
280280
}
281281
#endif
282282
#ifdef __CUDA
@@ -327,7 +327,7 @@ void BlasConnector::gemm_cm(const char transa,
327327
#ifdef __DSP
328328
else if (device_type == base_device::AbacusDevice_t::DspDevice)
329329
{
330-
mtfunc::zgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK);
330+
mtfunc::zgemm_mth_(&transa, &transb, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc, GlobalV::MY_RANK % 4);
331331
}
332332
#endif
333333
#ifdef __CUDA

source/source_base/module_fft/fft_dsp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void FFT_DSP<double>::initfft(int nx_in, int ny_in, int nz_in)
1414
this->nx = nx_in;
1515
this->ny = ny_in;
1616
this->nz = nz_in;
17-
cluster_id = GlobalV::MY_RANK;
17+
cluster_id = GlobalV::MY_RANK % 4;
1818
nxyz = this->nx * this->ny * this->nz;
1919
}
2020
template <>

source/source_main/driver_run.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void Driver::init_hardware()
129129

130130
#ifdef __DSP
131131
std::cout << " ** Initializing DSP Hardware..." << std::endl;
132-
mtfunc::dspInitHandle(GlobalV::MY_RANK);
132+
mtfunc::dspInitHandle(GlobalV::MY_RANK % 4);
133133
#endif
134134
}
135135

0 commit comments

Comments
 (0)