Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uint32 and uint64 kernel support for Invert #15154

Merged
merged 4 commits into from
Feb 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensorflow/core/kernels/cwise_op_gpu_invert.cu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.

namespace tensorflow {
namespace functor {
DEFINE_UNARY6(invert, int8, int16, int32, int64, uint8, uint16);
DEFINE_UNARY8(invert, int8, int16, int32, int64, uint8, uint16, uint32, uint64);
} // namespace functor
} // namespace tensorflow

Expand Down
10 changes: 5 additions & 5 deletions tensorflow/core/kernels/cwise_op_invert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ limitations under the License.
#include "tensorflow/core/kernels/cwise_ops_common.h"

namespace tensorflow {
REGISTER6(UnaryOp, CPU, "Invert", functor::invert, int8, int16, int32, int64,
uint8, uint16);
REGISTER8(UnaryOp, CPU, "Invert", functor::invert, int8, int16, int32, int64,
uint8, uint16, uint32, uint64);

#ifdef TENSORFLOW_USE_SYCL
REGISTER6(UnaryOp, SYCL, "Invert", functor::invert, int8, int16, int32, int64,
uint8, uint16);
uint8, uint16, uint32, uint64);
#endif // TENSORFLOW_USE_SYCL

#if GOOGLE_CUDA
REGISTER6(UnaryOp, GPU, "Invert", functor::invert, int8, int16, int32, int64,
uint8, uint16);
REGISTER8(UnaryOp, GPU, "Invert", functor::invert, int8, int16, int32, int64,
uint8, uint16, uint32, uint64);
#endif // GOOGLE_CUDA

} // namespace tensorflow
3 changes: 3 additions & 0 deletions tensorflow/core/kernels/cwise_ops_gpu_common.cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ struct ApproximateEqual<GPUDevice, T> {
#define DEFINE_UNARY7(F, T0, T1, T2, T3, T4, T5, T6) \
DEFINE_UNARY2(F, T0, T1); \
DEFINE_UNARY5(F, T2, T3, T4, T5, T6)
#define DEFINE_UNARY8(F, T0, T1, T2, T3, T4, T5, T6, T7) \
DEFINE_UNARY4(F, T0, T1, T2, T3); \
DEFINE_UNARY4(F, T4, T5, T6, T7)

// Macros to explicitly instantiate kernels on GPU for multiple types
// (T0, T1, etc.) for BinaryFunctor.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/python/ops/bitwise_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def count_bits(x):

def testInvertOp(self):
dtype_list = [dtypes.int8, dtypes.int16, dtypes.int32, dtypes.int64,
dtypes.uint8, dtypes.uint16]
dtypes.uint8, dtypes.uint16, dtypes.uint32, dtypes.uint64]
inputs = [0, 5, 3, 14]
with self.test_session(use_gpu=True) as sess:
for dtype in dtype_list:
Expand Down