Skip to content

Commit

Permalink
[OpenCL] Registers RGBToHSV and HSVToRGB (#91) (tensorflow#10848)
Browse files Browse the repository at this point in the history
* [OpenCL] Added RGBToHSV and HSVToRGB

* Aligning '\'
  • Loading branch information
Luke Iwanski authored and benoitsteiner committed Jun 22, 2017
1 parent 832894e commit fc73610
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tensorflow/core/kernels/colorspace_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ namespace tensorflow {

typedef Eigen::ThreadPoolDevice CPUDevice;
typedef Eigen::GpuDevice GPUDevice;
#ifdef TENSORFLOW_USE_SYCL
typedef Eigen::SyclDevice SYCLDevice;
#endif

template <typename Device, typename T>
class RGBToHSVOp : public OpKernel {
Expand Down Expand Up @@ -146,4 +149,16 @@ TF_CALL_float(REGISTER_GPU);
TF_CALL_double(REGISTER_GPU);
#endif

#ifdef TENSORFLOW_USE_SYCL
#define REGISTER_SYCL(T) \
REGISTER_KERNEL_BUILDER(Name("RGBToHSV").Device(DEVICE_SYCL) \
.TypeConstraint<T>("T"), \
RGBToHSVOp<SYCLDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("HSVToRGB").Device(DEVICE_SYCL) \
.TypeConstraint<T>("T"), \
HSVToRGBOp<SYCLDevice, T>);
TF_CALL_float(REGISTER_SYCL);
TF_CALL_double(REGISTER_SYCL);
#endif

} // namespace tensorflow

0 comments on commit fc73610

Please sign in to comment.