![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|


Go to the source code of this file.
Macros | |
| #define | DISPATCH_DTYPE_TO_TEMPLATE(DTYPE, ...) |
| #define | DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL(DTYPE, ...) |
| #define | DISPATCH_FLOAT_DTYPE_TO_TEMPLATE(DTYPE, ...) |
| #define | DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE(FDTYPE, IDTYPE, ...) |
| #define | DISPATCH_INT_DTYPE_PREFIX_TO_TEMPLATE(DTYPE, PREFIX, ...) |
| #define DISPATCH_DTYPE_TO_TEMPLATE | ( | DTYPE, | |
| ... | |||
| ) |
Call a numerical templated function based on Dtype. Wrap the function to a lambda function to use DISPATCH_DTYPE_TO_TEMPLATE.
Before: if (dtype == core::Float32) { func<float>(args); } else if (dtype == core::Float64) { func<double>(args); } else ...
Now: DISPATCH_DTYPE_TO_TEMPLATE(dtype, [&]() { func<scalar_t>(args); });
Inspired by: https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/Dispatch.h
Definition at line 31 of file Dispatch.h.
| #define DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL | ( | DTYPE, | |
| ... | |||
| ) |
Definition at line 68 of file Dispatch.h.
| #define DISPATCH_FLOAT_DTYPE_TO_TEMPLATE | ( | DTYPE, | |
| ... | |||
| ) |
Definition at line 78 of file Dispatch.h.
| #define DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE | ( | FDTYPE, | |
| IDTYPE, | |||
| ... | |||
| ) |
Definition at line 91 of file Dispatch.h.
| #define DISPATCH_INT_DTYPE_PREFIX_TO_TEMPLATE | ( | DTYPE, | |
| PREFIX, | |||
| ... | |||
| ) |
Definition at line 118 of file Dispatch.h.