forked from mindspore-Ecosystem/mindspore
cumsum cpu kernel codedex
This commit is contained in:
parent
888f5b8317
commit
aee56173c4
|
@ -222,9 +222,13 @@ void CumSumCPUKernel::LaunchKernel(const std::vector<kernel::AddressPtr> &inputs
|
||||||
std::vector<std::thread> threads;
|
std::vector<std::thread> threads;
|
||||||
threads.reserve(thread_num);
|
threads.reserve(thread_num);
|
||||||
size_t start = 0;
|
size_t start = 0;
|
||||||
|
if (thread_num < 1) {
|
||||||
|
MS_LOG(ERROR) << "Invalid value: thread_num " << thread_num;
|
||||||
|
return;
|
||||||
|
}
|
||||||
size_t once_compute_size = (lens + thread_num - 1) / thread_num;
|
size_t once_compute_size = (lens + thread_num - 1) / thread_num;
|
||||||
if (thread_num < 1 || once_compute_size < 1) {
|
if (once_compute_size < 1) {
|
||||||
MS_LOG(ERROR) << "Invalid value: thread_num " << thread_num << "; once_compute_size " << once_compute_size;
|
MS_LOG(ERROR) << "Invalid value: once_compute_size " << once_compute_size;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (start < lens) {
|
while (start < lens) {
|
||||||
|
|
Loading…
Reference in New Issue