浏览代码

cumsum cpu kernel codedex

pull/15708/head
shaoxiangdong 4 年前
父节点
当前提交
aee56173c4
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. +6
    -2
      mindspore/ccsrc/backend/kernel_compiler/cpu/cumsum_cpu_kernel.cc

+ 6
- 2
mindspore/ccsrc/backend/kernel_compiler/cpu/cumsum_cpu_kernel.cc 查看文件

@@ -222,9 +222,13 @@ void CumSumCPUKernel::LaunchKernel(const std::vector<kernel::AddressPtr> &inputs
std::vector<std::thread> threads;
threads.reserve(thread_num);
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;
if (thread_num < 1 || once_compute_size < 1) {
MS_LOG(ERROR) << "Invalid value: thread_num " << thread_num << "; once_compute_size " << once_compute_size;
if (once_compute_size < 1) {
MS_LOG(ERROR) << "Invalid value: once_compute_size " << once_compute_size;
return;
}
while (start < lens) {


正在加载...
取消
保存