Skip to content

Commit

Permalink
Merge pull request tensorflow#1503 from ROCmSoftwarePlatform/deven/av…
Browse files Browse the repository at this point in the history
…gpooling_unit_test_fix

 Fix for a regression in the unit test `//tensorflow/python/kernel_tests/nn_ops:pooling_ops_test_gpu`
  • Loading branch information
deven-amd committed Nov 30, 2021
2 parents 8f3c395 + a760f34 commit 75f3217
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tensorflow/core/kernels/eigen_pooling.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ struct AvgPoolMeanReducer {

EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE AvgPoolMeanReducer() : scalarCount_(0) {
typedef typename packet_traits<T>::type Packet;
#if defined(__HIPCC__)
packetCount_ = 0;
#else
packetCount_ = pset1<Packet>(T(0.0));
#endif
}

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T* accum) {
Expand All @@ -305,6 +309,7 @@ struct AvgPoolMeanReducer {

#if (EIGEN_ARCH_i386 || EIGEN_ARCH_x86_64) && !defined(__CUDACC__) && \
!defined(__HIPCC__)

#ifdef EIGEN_VECTORIZE_AVX512
#define pequal(a, b) \
_mm512_castsi512_ps( \
Expand Down Expand Up @@ -364,7 +369,11 @@ struct AvgPoolMeanReducer {
protected:
typedef typename packet_traits<T>::type Packet;
int scalarCount_;
#if defined(__HIPCC__)
int packetCount_;
#else
Packet packetCount_;
#endif
};

template <typename Device>
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/python/kernel_tests/nn_ops/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ cuda_py_test(
srcs = ["pooling_ops_test.py"],
shard_count = 10,
# Some operations in this test can only be checked on sm61+.
tags = ["prefer-sm70", "no_rocm"],
tags = ["prefer-sm70"],
deps = [
"//tensorflow/python:array_ops",
"//tensorflow/python:client_testlib",
Expand Down

0 comments on commit 75f3217

Please sign in to comment.