 class CudaMaxPoolForwardBackward : public chainerx::MaxPoolForwardBackward {
 public:
     explicit CudaMaxPoolForwardBackward(
-            cudnnHandle_t cudnn_handle,
+            CudaDevice& device,
             const StackVector<int64_t, kMaxNdim>& kernel_size,
             const StackVector<int64_t, kMaxNdim>& stride,
             const StackVector<int64_t, kMaxNdim>& pad,
             bool cover_all)
-        : pool_impl_{cudnn_handle, kernel_size, stride, pad, cover_all, CUDNN_POOLING_MAX} {}
+        : pool_impl_{device, kernel_size, stride, pad, cover_all, CUDNN_POOLING_MAX} {}
 
     Array Forward(const Array& x) override { return pool_impl_.Forward(x); }
 


        cuda_internal::CudnnPoolingDescriptor pool_desc{cudnn_pooling_mode_, CUDNN_NOT_PROPAGATE_NAN, kernel_size_, pad_, stride_};

        CheckCudnnError(cudnnPoolingForward(
                cudnn_handle_,
                *pool_desc,
                cuda_internal::GetValuePtr<1>(x.dtype()),
                *x_desc,
                internal::GetRawOffsetData<void>(x_cont),
                cuda_internal::GetValuePtr<0>(x.dtype()),
                *y_desc,
                internal::GetRawOffsetData<void>(y)));

        x_ = x;
        y_ = y;

        const StackVector<int64_t, kMaxNdim>& stride,
        const StackVector<int64_t, kMaxNdim>& pad,
        AveragePoolPadMode pad_mode) {
    return std::make_unique<CudaAveragePoolForwardBackward>(*this, kernel_size, stride, pad, pad_mode);
}

}  // namespace cuda
