Clean up target device type verification code 25/233125/3
authorInki Dae <inki.dae@samsung.com>
Tue, 12 May 2020 09:10:46 +0000 (18:10 +0900)
committerInki Dae <inki.dae@samsung.com>
Wed, 13 May 2020 01:28:43 +0000 (10:28 +0900)
INFERENCE_TARGET_MASK definition isn't needed so drop it
and use INFERENCE_TARGET_MAX instead.

Change-Id: I913f29f6963be95614307e12a0c8abb381b8c1c4
Signed-off-by: Inki Dae <inki.dae@samsung.com>
src/inference_engine_common_impl.cpp

index 50dac93..2afd8f1 100755 (executable)
@@ -35,7 +35,6 @@ extern "C" {
 #define LOG_TAG "INFERENCE_ENGINE_COMMON"
 }
 
-#define INFERENCE_TARGET_TYPE_MASK     (INFERENCE_TARGET_CPU | INFERENCE_TARGET_GPU | INFERENCE_TARGET_CUSTOM)
 #define CHECK_ENGINE_INSTANCE(object)                                          \
        if (object == nullptr) {                                                                \
                LOGE("Inference engine handle is null.");                       \
@@ -239,7 +238,7 @@ int InferenceEngineCommon::SetTargetDevices(int types)
 {
        CHECK_ENGINE_INSTANCE(mBackendHandle);
 
-       if (INFERENCE_TARGET_NONE >= types || INFERENCE_TARGET_TYPE_MASK < types) {
+       if (types <= INFERENCE_TARGET_NONE || types >= INFERENCE_TARGET_MAX) {
                LOGE("Given target device types(%d) are invalid.", types);
                return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
        }