Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
b3fac0cd
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b3fac0cd
编写于
8月 20, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
8月 20, 2020
浏览文件
操作
浏览文件
下载
差异文件
!4836 [MS][LITE][GPU]fix softmax random error
Merge pull request !4836 from chenzupeng/master-lite
上级
cde4a81b
3ec333e8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
17 deletion
+13
-17
build.sh
build.sh
+10
-15
mindspore/lite/src/runtime/kernel/opencl/kernel/softmax.cc
mindspore/lite/src/runtime/kernel/opencl/kernel/softmax.cc
+1
-1
mindspore/lite/src/runtime/opencl/opencl_allocator.cc
mindspore/lite/src/runtime/opencl/opencl_allocator.cc
+2
-1
未找到文件。
build.sh
浏览文件 @
b3fac0cd
...
...
@@ -482,22 +482,17 @@ gene_ocl_program() {
SPIRV_DIR
=
build/spirv
rm
-rf
${
SPIRV_DIR
}
mkdir
-pv
${
SPIRV_DIR
}
for
sub_dir
in
"
${
CL_SRC_DIR
}
"
/
*
if
[
!
-d
${
CL_SRC_DIR
}
]
;
then
return
fi
for
file_path
in
"
${
CL_SRC_DIR
}
"
/
*
do
data_type
=
"
$(
basename
${
sub_dir
}
)
"
if
[
!
-d
${
CL_SRC_DIR
}
/
${
data_type
}
]
;
then
continue
fi
#echo $(cd "$(dirname $0)"; pwd)
for
file_path
in
"
${
CL_SRC_DIR
}
/
${
data_type
}
"
/
*
do
file
=
"
$(
basename
${
file_path
}
)
"
if
[
"
${
file
##*.
}
"
!=
"cl"
]
;
then
continue
fi
clang
-Xclang
-finclude-default-header
-cl-std
=
CL2.0
--target
=
spir64-unknown-unknown
-emit-llvm
\
-c
-O0
-o
${
SPIRV_DIR
}
/
${
file
%.*
}
.bc
${
CL_SRC_DIR
}
/
${
data_type
}
/
${
file
}
done
file
=
"
$(
basename
${
file_path
}
)
"
if
[
"
${
file
##*.
}
"
!=
"cl"
]
;
then
continue
fi
clang
-Xclang
-finclude-default-header
-cl-std
=
CL2.0
--target
=
spir64-unknown-unknown
-emit-llvm
\
-c
-O0
-o
${
SPIRV_DIR
}
/
${
file
%.*
}
.bc
${
CL_SRC_DIR
}
/
${
file
}
done
bcs
=
`
ls
${
SPIRV_DIR
}
/
*
.bc
`
...
...
mindspore/lite/src/runtime/kernel/opencl/kernel/softmax.cc
浏览文件 @
b3fac0cd
...
...
@@ -33,7 +33,7 @@ using mindspore::schema::PrimitiveType_SoftMax;
namespace
mindspore
::
kernel
{
std
::
vector
<
float
>
SoftmaxOpenCLKernel
::
GetMaskForLastChannel
(
int
channels
)
{
std
::
vector
<
float
>
mask
{
4
,
0.0
f
};
std
::
vector
<
float
>
mask
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
const
int
reminder
=
channels
%
4
==
0
?
4
:
channels
%
4
;
for
(
int
i
=
0
;
i
<
reminder
;
++
i
)
{
mask
[
i
]
=
1.0
f
;
...
...
mindspore/lite/src/runtime/opencl/opencl_allocator.cc
浏览文件 @
b3fac0cd
...
...
@@ -109,8 +109,9 @@ void *OpenCLAllocator::Malloc(size_t size, const std::vector<size_t> &img_size)
cl
::
Image2D
*
image
=
new
(
std
::
nothrow
)
cl
::
Image2D
(
*
ocl_runtime
->
Context
(),
image_format
,
*
buffer
,
img_size
[
0
],
img_size
[
1
],
img_pitch
*
sizeof
(
cl_float4
),
&
ret
);
if
(
image
==
nullptr
||
ret
!=
CL_SUCCESS
)
{
MS_LOG
(
ERROR
)
<<
"Create OpenCL Image2D failed! (ERROR CODE: "
<<
ret
<<
")"
;
delete
buffer
;
UnLock
();
MS_LOG
(
ERROR
)
<<
"Create OpenCL Image2D failed! (ERROR CODE: "
<<
ret
<<
")"
;
return
nullptr
;
}
MS_LOG
(
DEBUG
)
<<
"Malloc a new Image2D, width="
<<
img_size
[
0
]
<<
", height="
<<
img_size
[
1
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录