// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#pragma once
#include "vision.h"

at::Tensor overlap_3d(const at::Tensor& boxes_1, const at::Tensor& boxes_2) {
    if (boxes_1.type().is_cuda() & boxes_2.type().is_cuda()) {
        // TODO raise error if not compiled with CUDA
        if ((boxes_1.numel() == 0) | (boxes_2.numel() == 0)) {
            return at::empty({0}, boxes_1.options().dtype(at::kLong).device(at::kCPU));
        }
        return overlap_3d_cuda(boxes_1, boxes_2);
    }
    AT_ERROR("Not implemented on the CPU");
}
