* @brief Defines #MV_INFERENCE_TARGET_TYPE to set the type used
* for device running attribute of the engine configuration.
* @details Switches between CPU, GPU, or Custom:\n
- * #MV_INFERENCE_TARGET_CPU(Deprecated),\n
- * #MV_INFERENCE_TARGET_GPU(Deprecated),\n
- * #MV_INFERENCE_TARGET_CUSTOM(Deprecated).\n
- * #MV_INFERENCE_CPU,\n
- * #MV_INFERENCE_GPU,\n
- * #MV_INFERENCE_CUSTOM.\n
+ * #MV_INFERENCE_TARGET_CPU (Deprecated),\n
+ * #MV_INFERENCE_TARGET_GPU (Deprecated),\n
+ * #MV_INFERENCE_TARGET_CUSTOM (Deprecated).\n
+ * #MV_INFERENCE_TARGET_DEVICE_CPU,\n
+ * #MV_INFERENCE_TARGET_DEVICE_GPU,\n
+ * #MV_INFERENCE_TARGET_DEVICE_CUSTOM.\n
*
* The default type is CPU. Please do not use deprecated types since Tizen 6.0.
* Old ones have been deprecated.
* @deprecated Deprecated since tizen 6.0. Use #mv_inference_target_device_e instead.
* @brief Enumeration for inference target.
*
+ * @since_tizem 5.5
+ *
*/
typedef enum {
MV_INFERENCE_TARGET_NONE = -1, /**< None */
*
*/
typedef enum {
- MV_INFERENCE_NONE = 0, /**< None */
- MV_INFERENCE_CPU = 1 << 0, /**< CPU */
- MV_INFERENCE_GPU = 1 << 1, /**< GPU*/
- MV_INFERENCE_CUSTOM = 1 << 2, /**< CUSTOM*/
- MV_INFERENCE_MAX = 1 << 3 /**< Target MAX */
+ MV_INFERENCE_TARGET_DEVICE_NONE = 0, /**< None */
+ MV_INFERENCE_TARGET_DEVICE_CPU = 1 << 0, /**< CPU */
+ MV_INFERENCE_TARGET_DEVICE_GPU = 1 << 1, /**< GPU*/
+ MV_INFERENCE_TARGET_DEVICE_CUSTOM = 1 << 2, /**< CUSTOM*/
+ MV_INFERENCE_TARGET_DEVICE_MAX = 1 << 3 /**< Target MAX */
} mv_inference_target_device_e;
/**
*
*/
typedef enum {
- MV_INFERENCE_DATA_FLOAT32 = 0,
- MV_INFERENCE_DATA_UINT8
+ MV_INFERENCE_DATA_FLOAT32 = 0, /** Data type of a given pre-trained model is float. */
+ MV_INFERENCE_DATA_UINT8 /** Data type of a given pre-trained model is unsigned char. */
} mv_inference_data_type_e;
/**
{
int target_types = INFERENCE_TARGET_NONE;
- if (given_types & MV_INFERENCE_CPU)
+ if (given_types & MV_INFERENCE_TARGET_DEVICE_CPU)
target_types |= INFERENCE_TARGET_CPU;
- if (given_types & MV_INFERENCE_GPU)
+ if (given_types & MV_INFERENCE_TARGET_DEVICE_GPU)
target_types |= INFERENCE_TARGET_GPU;
- if (given_types & MV_INFERENCE_CUSTOM)
+ if (given_types & MV_INFERENCE_TARGET_DEVICE_CUSTOM)
target_types |= INFERENCE_TARGET_CUSTOM;
return target_types;
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
- unsigned int new_type = MV_INFERENCE_NONE;
+ unsigned int new_type = MV_INFERENCE_TARGET_DEVICE_NONE;
// Convert old type to new one.
switch (targetType) {
case MV_INFERENCE_TARGET_CPU:
- new_type = MV_INFERENCE_CPU;
+ new_type = MV_INFERENCE_TARGET_DEVICE_CPU;
break;
case MV_INFERENCE_TARGET_GPU:
- new_type = MV_INFERENCE_GPU;
+ new_type = MV_INFERENCE_TARGET_DEVICE_GPU;
break;
case MV_INFERENCE_TARGET_CUSTOM:
- new_type = MV_INFERENCE_CUSTOM;
+ new_type = MV_INFERENCE_TARGET_DEVICE_CUSTOM;
break;
}
int Inference::ConfigureTargetDevices(const int targetDevices)
{
// Check if given target types are valid or not.
- if (MV_INFERENCE_NONE >= targetDevices || MV_INFERENCE_MAX <= targetDevices) {
+ if (MV_INFERENCE_TARGET_DEVICE_NONE >= targetDevices || MV_INFERENCE_TARGET_DEVICE_MAX <= targetDevices) {
LOGE("Invalid target device.");
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
LOGI("threshold %.4f", mThreshold);
// Check if backend supports a given target device/devices or not.
- if (mConfig.mTargetTypes & MV_INFERENCE_CPU) {
+ if (mConfig.mTargetTypes & MV_INFERENCE_TARGET_DEVICE_CPU) {
if (!(mBackendCapacity.supported_accel_devices & INFERENCE_TARGET_CPU)) {
LOGE("Backend doesn't support CPU device as an accelerator.");
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
}
- if (mConfig.mTargetTypes & MV_INFERENCE_GPU) {
+ if (mConfig.mTargetTypes & MV_INFERENCE_TARGET_DEVICE_GPU) {
if (!(mBackendCapacity.supported_accel_devices & INFERENCE_TARGET_GPU)) {
LOGE("Backend doesn't support CPU device as an accelerator.");
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
}
- if (mConfig.mTargetTypes & MV_INFERENCE_CUSTOM) {
+ if (mConfig.mTargetTypes & MV_INFERENCE_TARGET_DEVICE_CUSTOM) {
if (!(mBackendCapacity.supported_accel_devices & INFERENCE_TARGET_CUSTOM)) {
LOGE("Backend doesn't support CPU device as an accelerator.");
return MEDIA_VISION_ERROR_INVALID_PARAMETER;