Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
tensorflow
提交
844aa275
T
tensorflow
项目概览
xxadev
/
tensorflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tensorflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
844aa275
编写于
7月 11, 2019
作者:
P
Penporn Koanantakool
提交者:
TensorFlower Gardener
7月 11, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix clang compilation errors in TF-MKL variant.
PiperOrigin-RevId: 257656880
上级
765f71b8
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
9 deletion
+14
-9
tensorflow/core/common_runtime/mkl_cpu_allocator.h
tensorflow/core/common_runtime/mkl_cpu_allocator.h
+1
-0
tensorflow/core/kernels/BUILD
tensorflow/core/kernels/BUILD
+2
-1
tensorflow/core/kernels/gather_nd_op_cpu_impl.h
tensorflow/core/kernels/gather_nd_op_cpu_impl.h
+4
-1
tensorflow/core/kernels/mkl_conv_ops.h
tensorflow/core/kernels/mkl_conv_ops.h
+0
-2
tensorflow/core/kernels/mkl_pooling_ops_common.h
tensorflow/core/kernels/mkl_pooling_ops_common.h
+2
-1
tensorflow/core/kernels/mkl_qmatmul_op.cc
tensorflow/core/kernels/mkl_qmatmul_op.cc
+2
-1
tensorflow/core/util/mkl_util.h
tensorflow/core/util/mkl_util.h
+3
-3
未找到文件。
tensorflow/core/common_runtime/mkl_cpu_allocator.h
浏览文件 @
844aa275
...
...
@@ -253,6 +253,7 @@ class MklCPUAllocator : public Allocator {
auto
l_stats
=
large_size_allocator_
->
GetStats
();
// Combine statistics from small-size and large-size allocator.
mutex_lock
l
(
mutex_
);
stats_
.
num_allocs
=
l_stats
->
num_allocs
+
s_stats
->
num_allocs
;
stats_
.
bytes_in_use
=
l_stats
->
bytes_in_use
+
s_stats
->
bytes_in_use
;
stats_
.
peak_bytes_in_use
=
...
...
tensorflow/core/kernels/BUILD
浏览文件 @
844aa275
...
...
@@ -34,7 +34,6 @@ load(
)
load
(
"//third_party/mkl:build_defs.bzl"
,
"if_mkl"
,
"if_mkl_ml"
,
"mkl_deps"
,
)
...
...
@@ -7465,8 +7464,10 @@ tf_mkl_kernel_library(
],
deps
=
[
":bounds_check"
,
":fill_functor"
,
":matmul_op"
,
":ops_util"
,
"//third_party/eigen3"
,
"//tensorflow/core:core_cpu"
,
"//tensorflow/core:framework"
,
"//tensorflow/core:lib"
,
...
...
tensorflow/core/kernels/gather_nd_op_cpu_impl.h
浏览文件 @
844aa275
...
...
@@ -107,13 +107,16 @@ struct GatherNdSlice<CPUDevice, T, Index, IXDIM> {
Eigen
::
Tensor
<
Eigen
::
DenseIndex
,
1
>::
Dimensions
reshape_dims
{{
1
}};
Eigen
::
array
<
Eigen
::
DenseIndex
,
1
>
broadcast_dims
{{
batch_size
}};
#else
#if !defined(INTEL_MKL) || !defined(ENABLE_MKL)
Eigen
::
IndexList
<
Eigen
::
type2index
<
1
>
>
reshape_dims
;
#endif // defined(INTEL_MKL) && defined(ENABLE_MKL)
Eigen
::
IndexList
<
Eigen
::
DenseIndex
>
broadcast_dims
;
broadcast_dims
.
set
(
0
,
batch_size
);
#endif
#endif
// !defined(EIGEN_HAS_INDEX_LIST)
generator
::
GatherNdSliceGenerator
<
T
,
Index
,
IXDIM
>
gather_nd_generator
(
slice_size
,
Tindices
,
Tparams
,
Tout
,
&
error_loc
);
// TODO(b/137289929): Parallelize this with ParallelFor and remove OpenMP call.
#if defined(INTEL_MKL) && defined(ENABLE_MKL)
// Eigen implementation below is not highly performant. gather_nd_generator
// does not seem to be called in parallel, leading to very poor performance.
...
...
tensorflow/core/kernels/mkl_conv_ops.h
浏览文件 @
844aa275
...
...
@@ -562,8 +562,6 @@ class MklConvBackpropCommonOp : public OpKernel {
OP_REQUIRES_OK
(
context
,
context
->
GetAttr
(
"strides"
,
&
strides_
));
int
stride_n
=
GetTensorDim
(
strides_
,
data_format_
,
'N'
);
int
stride_c
=
GetTensorDim
(
strides_
,
data_format_
,
'C'
);
const
int64
stride_h
=
GetTensorDim
(
strides_
,
data_format_
,
'H'
);
const
int64
stride_w
=
GetTensorDim
(
strides_
,
data_format_
,
'W'
);
OP_REQUIRES
(
context
,
(
stride_n
==
1
&&
stride_c
==
1
),
errors
::
InvalidArgument
(
"Current implementation does not yet support "
...
...
tensorflow/core/kernels/mkl_pooling_ops_common.h
浏览文件 @
844aa275
...
...
@@ -464,7 +464,8 @@ class MklPoolingOpBase : public OpKernel {
// We may not get this attribute for this node if it does not go through
// graph rewrite pass. So we do not check for error while retrieving this
// attribute value.
context
->
GetAttr
(
"workspace_enabled"
,
&
this
->
workspace_enabled_
);
TF_CHECK_OK
(
context
->
GetAttr
(
"workspace_enabled"
,
&
this
->
workspace_enabled_
));
}
void
Compute
(
OpKernelContext
*
context
)
override
=
0
;
...
...
tensorflow/core/kernels/mkl_qmatmul_op.cc
浏览文件 @
844aa275
...
...
@@ -222,10 +222,10 @@ class MklDnnMatMulFwdPrimitive : public MklPrimitive {
bias_mem
(
nullptr
),
dst_mem
(
nullptr
),
fwd_desc
(
nullptr
),
fwd_pd
(
nullptr
),
src_md
(
nullptr
),
weight_md
(
nullptr
),
bias_md
(
nullptr
),
fwd_pd
(
nullptr
),
matmul_fwd
(
nullptr
),
fwd_stream
(
nullptr
)
{}
};
...
...
@@ -719,6 +719,7 @@ class MklDnnQuantizedMatMulOp : public OpKernel {
context
->
CtxFailure
(
errors
::
InvalidArgument
(
"Quantization mode must be"
"either MIN_FIRST or SCALED."
));
return
nullptr
;
}
}
}
...
...
tensorflow/core/util/mkl_util.h
浏览文件 @
844aa275
...
...
@@ -525,8 +525,8 @@ inline Tensor ConvertMklToTF(OpKernelContext* context, const Tensor& mkl_tensor,
TensorShape
output_shape
=
mkl_shape
.
GetTfShape
();
// Allocate output tensor.
context
->
allocate_temp
(
DataTypeToEnum
<
T
>::
v
(),
output_shape
,
&
output_tensor
);
TF_CHECK_OK
(
context
->
allocate_temp
(
DataTypeToEnum
<
T
>::
v
(),
output_shape
,
&
output_tensor
)
);
auto
cpu_engine
=
engine
(
engine
::
cpu
,
0
);
MklDnnData
<
T
>
input
(
&
cpu_engine
);
...
...
@@ -576,7 +576,7 @@ inline const Tensor& MklGetInput(OpKernelContext* ctext, int n) {
inline
void
GetMklInputList
(
OpKernelContext
*
ctext
,
StringPiece
name
,
OpInputList
*
input_tensors
)
{
CHECK_NOTNULL
(
input_tensors
);
ctext
->
input_list
(
name
,
input_tensors
);
TF_CHECK_OK
(
ctext
->
input_list
(
name
,
input_tensors
)
);
}
inline
void
GetMklShapeList
(
OpKernelContext
*
ctext
,
StringPiece
name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录