|
Open3D (C++ API)
0.13.0
|
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_DTYPE_TO_TEMPLATE | ( | DTYPE, | |
| ... | |||
| ) |
Call a numerical templated function based on Dtype. Warp the function to a lambda function to use DISPATCH_DTYPE_TO_TEMPLATE.
Before: if (dtype == Dtype::Float32) { func<float>(args); } else if (dtype == Dtype::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
| #define DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL | ( | DTYPE, | |
| ... | |||
| ) |
| #define DISPATCH_FLOAT_DTYPE_TO_TEMPLATE | ( | DTYPE, | |
| ... | |||
| ) |
1.8.13