(3975044 (Wed Oct 9 17:28:16 2024 +0200))
Go to the source code of this file.
◆ DISPATCH_DTYPE_TO_TEMPLATE
#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
◆ DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL
#define DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL |
( |
|
DTYPE, |
|
|
|
... |
|
) |
| |
Value: [&] { \
using scalar_t = bool; \
return __VA_ARGS__(); \
} else { \
DISPATCH_DTYPE_TO_TEMPLATE(DTYPE, __VA_ARGS__); \
} \
}()
const Dtype Bool
Definition: Dtype.cpp:52
◆ DISPATCH_FLOAT_DTYPE_TO_TEMPLATE
#define DISPATCH_FLOAT_DTYPE_TO_TEMPLATE |
( |
|
DTYPE, |
|
|
|
... |
|
) |
| |
Value: [&] { \
using scalar_t =
float; \
return __VA_ARGS__(); \
using scalar_t = double; \
return __VA_ARGS__(); \
} \
}()
#define LogError(...)
Definition: Logging.h:51
const Dtype Float64
Definition: Dtype.cpp:43
const Dtype Float32
Definition: Dtype.cpp:42
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle float
Definition: K4aPlugin.cpp:460
◆ DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE
#define DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE |
( |
|
FDTYPE, |
|
|
|
IDTYPE, |
|
|
|
... |
|
) |
| |
Value: [&] { \
using scalar_t =
float; \
return __VA_ARGS__(); \
using scalar_t =
float; \
using int_t = int64_t; \
return __VA_ARGS__(); \
using scalar_t = double; \
return __VA_ARGS__(); \
using scalar_t = double; \
using int_t = int64_t; \
return __VA_ARGS__(); \
} \
}()
const Dtype Int64
Definition: Dtype.cpp:47
const Dtype Int32
Definition: Dtype.cpp:46
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t int32_t
Definition: K4aPlugin.cpp:395
◆ DISPATCH_INT_DTYPE_PREFIX_TO_TEMPLATE
#define DISPATCH_INT_DTYPE_PREFIX_TO_TEMPLATE |
( |
|
DTYPE, |
|
|
|
PREFIX, |
|
|
|
... |
|
) |
| |
Value: [&] { \
using scalar_##PREFIX##_t = int8_t; \
return __VA_ARGS__(); \
using scalar_##PREFIX##_t = int16_t; \
return __VA_ARGS__(); \
using scalar_##PREFIX##_t =
int32_t; \
return __VA_ARGS__(); \
using scalar_##PREFIX##_t = int64_t; \
return __VA_ARGS__(); \
using scalar_##PREFIX##_t = uint8_t; \
return __VA_ARGS__(); \
using scalar_##PREFIX##_t = uint16_t; \
return __VA_ARGS__(); \
return __VA_ARGS__(); \
return __VA_ARGS__(); \
} \
}()
const Dtype UInt32
Definition: Dtype.cpp:50
const Dtype UInt16
Definition: Dtype.cpp:49
const Dtype Int16
Definition: Dtype.cpp:45
const Dtype UInt8
Definition: Dtype.cpp:48
const Dtype UInt64
Definition: Dtype.cpp:51
const Dtype Int8
Definition: Dtype.cpp:44
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle uint32_t
Definition: K4aPlugin.cpp:548
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample uint64_t
Definition: K4aPlugin.cpp:343