-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Create header files for kernel implementation and remove definitions from vision_*.h files. - Eliminate unnecessary headers and ensure all cpp include their headers.
- Loading branch information
Showing
8 changed files
with
148 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include <ATen/ATen.h> | ||
#include "../macros.h" | ||
|
||
VISION_API at::Tensor deform_conv2d_forward_cpu( | ||
const at::Tensor& input_param, | ||
const at::Tensor& weight_param, | ||
const at::Tensor& offset_param, | ||
const at::Tensor& mask_param, | ||
const at::Tensor& bias_param, | ||
int64_t stride_h, | ||
int64_t stride_w, | ||
int64_t pad_h, | ||
int64_t pad_w, | ||
int64_t dil_h, | ||
int64_t dil_w, | ||
int64_t n_weight_grps, | ||
int64_t n_offset_grps, | ||
bool use_mask); | ||
|
||
VISION_API std:: | ||
tuple<at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor> | ||
deform_conv2d_backward_cpu( | ||
const at::Tensor& grad_out_param, | ||
const at::Tensor& input_param, | ||
const at::Tensor& weight_param, | ||
const at::Tensor& offset_param, | ||
const at::Tensor& mask_param, | ||
const at::Tensor& bias_param, | ||
int64_t stride_h, | ||
int64_t stride_w, | ||
int64_t pad_h, | ||
int64_t pad_w, | ||
int64_t dil_h, | ||
int64_t dil_w, | ||
int64_t n_weight_grps, | ||
int64_t n_offset_grps, | ||
bool use_mask); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include <ATen/ATen.h> | ||
#include "../macros.h" | ||
|
||
VISION_API at::Tensor deform_conv2d_forward_cuda( | ||
const at::Tensor& input_param, | ||
const at::Tensor& weight_param, | ||
const at::Tensor& offset_param, | ||
const at::Tensor& mask_param, | ||
const at::Tensor& bias_param, | ||
int64_t stride_h, | ||
int64_t stride_w, | ||
int64_t pad_h, | ||
int64_t pad_w, | ||
int64_t dil_h, | ||
int64_t dil_w, | ||
int64_t n_weight_grps, | ||
int64_t n_offset_grps, | ||
bool use_mask); | ||
|
||
VISION_API std:: | ||
tuple<at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor> | ||
deform_conv2d_backward_cuda( | ||
const at::Tensor& grad_out_param, | ||
const at::Tensor& input_param, | ||
const at::Tensor& weight_param, | ||
const at::Tensor& offset_param, | ||
const at::Tensor& mask_param, | ||
const at::Tensor& bias_param, | ||
int64_t stride_h, | ||
int64_t stride_w, | ||
int64_t pad_h, | ||
int64_t pad_w, | ||
int64_t dil_h, | ||
int64_t dil_w, | ||
int64_t n_weight_grps, | ||
int64_t n_offset_grps, | ||
bool use_mask); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#pragma once | ||
|
||
#include "cpu/deform_conv2d_cpu.h" | ||
|
||
#ifdef WITH_CUDA | ||
#include "cuda/deform_conv2d_cuda.h" | ||
#endif | ||
#ifdef WITH_HIP | ||
#include "hip/deform_conv2d_cuda.h" | ||
#endif | ||
|
||
// Autocast Registration | ||
#if defined(WITH_CUDA) || defined(WITH_HIP) | ||
at::Tensor deform_conv2d_autocast( | ||
const at::Tensor& input, | ||
const at::Tensor& weight, | ||
const at::Tensor& offset, | ||
const at::Tensor& mask, | ||
const at::Tensor& bias, | ||
int64_t stride_h, | ||
int64_t stride_w, | ||
int64_t pad_h, | ||
int64_t pad_w, | ||
int64_t dilation_h, | ||
int64_t dilation_w, | ||
int64_t groups, | ||
int64_t offset_groups, | ||
bool use_mask); | ||
#endif | ||
|
||
// Autograd Registration | ||
at::Tensor deform_conv2d_autograd( | ||
const at::Tensor& input, | ||
const at::Tensor& weight, | ||
const at::Tensor& offset, | ||
const at::Tensor& mask, | ||
const at::Tensor& bias, | ||
int64_t stride_h, | ||
int64_t stride_w, | ||
int64_t pad_h, | ||
int64_t pad_w, | ||
int64_t dilation_h, | ||
int64_t dilation_w, | ||
int64_t groups, | ||
int64_t offset_groups, | ||
bool use_mask); | ||
|
||
std::tuple<at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor> | ||
deform_conv2d_backward_autograd( | ||
const at::Tensor& grad, | ||
const at::Tensor& input, | ||
const at::Tensor& weight, | ||
const at::Tensor& offset, | ||
const at::Tensor& mask, | ||
const at::Tensor& bias, | ||
int64_t stride_h, | ||
int64_t stride_w, | ||
int64_t pad_h, | ||
int64_t pad_w, | ||
int64_t dilation_h, | ||
int64_t dilation_w, | ||
int64_t groups, | ||
int64_t offset_groups, | ||
bool use_mask); |