LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_layer_client_example
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp $(LOCAL_PATH)/../../pow.cpp $(LOCAL_PATH)/../../mae_loss.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/arm64-v8a/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := knn_sample
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main_sample.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_logistic
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_mnist
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_product_ratings
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib -fexceptions -DUSING_CUSTOM_ENV
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/arm64-v8a/
LOCAL_CXXFLAGS += -std=c++17 -DUSING_CUSTOM_ENV -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_deepq
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp $(ENVDIR)/CartPole/cartpole.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_resnet
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp cifar_dataloader.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_classification
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_classification_func
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main_func.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_training
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -std=c++17 -Ofast -mcpu=cortex-a53 -Ilz4-nougat/lib
LOCAL_LDFLAGS += -Llz4-nougat/lib/obj/local/$(TARGET_ARCH_ABI)/
LOCAL_CXXFLAGS += -std=c++17 -frtti
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_LDFLAGS += -fexceptions
LOCAL_MODULE_TAGS := optional
LOCAL_ARM_MODE := arm
LOCAL_MODULE := nntrainer_vgg
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_SRC_FILES := main.cpp
UTILS_INCLUDES := $(NNTRAINER_APPLICATION)/utils/jni/includes
LOCAL_ARM_NEON := true
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_CXXFLAGS += -std=c++17 -frtti -fexceptions
LOCAL_LDFLAGS += -fuse-ld=bfd
LOCAL_MODULE_TAGS := optional
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_MODULE := app_utils
LOCAL_SRC_FILES := $(UTILS_SRCS)
INIPARSER_INCLUDES := $(INIPARSER_ROOT)/src
LOCAL_ARM_NEON := true
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_CXXFLAGS += -std=c++17 -frtti -fexceptions
LOCAL_LDFLAGS += -fuse-ld=bfd
LOCAL_MODULE_TAGS := optional
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_MODULE := nntrainer
LOCAL_SRC_FILES := $(NNTRAINER_SRCS) $(INIPARSER_SRCS)
LOCAL_SHARED_LIBRARIES := nntrainer
LOCAL_ARM_NEON := true
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_CXXFLAGS += -std=c++17 -frtti -fexceptions
LOCAL_LDFLAGS += -fuse-ld=bfd
LOCAL_MODULE_TAGS := optional
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_MODULE := ccapi-nntrainer
LOCAL_SRC_FILES := $(CCAPI_NNTRAINER_SRCS)
LOCAL_SHARED_LIBRARIES := ccapi-nntrainer ml-api-inference nntrainer
LOCAL_ARM_NEON := true
-LOCAL_CFLAGS += -pthread -fexceptions
+LOCAL_CFLAGS += -pthread -fexceptions -fopenmp
LOCAL_CXXFLAGS += -std=c++17 -frtti -fexceptions
LOCAL_LDFLAGS += -fuse-ld=bfd
LOCAL_MODULE_TAGS := optional
-LOCAL_LDLIBS := -llog -landroid
+LOCAL_LDLIBS := -llog -landroid -fopenmp
LOCAL_MODULE := capi-nntrainer
LOCAL_SRC_FILES := $(CAPI_NNTRAINER_SRCS)
endif
endif
+openmp_dep = dummy_dep
+if get_option('enable-openmp')
+ openmp_dep = dependency('openmp')
+endif
+
if get_option('enable-profile')
add_project_arguments('-DPROFILE=1', language:['c', 'cpp'])
endif
option('platform', type: 'combo', choices: ['none', 'tizen', 'yocto'], value: 'none')
-option('enable-blas', type: 'boolean', value: true)
-option('enable-cublas', type: 'boolean', value: false)
option('enable-app', type: 'boolean', value: true)
option('install-app', type: 'boolean', value: true)
option('use_gym', type: 'boolean', value: false)
# test related option
option('reduce-tolerance', type: 'boolean', value: true)
option('enable-long-test', type: 'boolean', value: false)
+
+# backend options
+option('enable-blas', type: 'boolean', value: true)
+option('enable-cublas', type: 'boolean', value: false)
+option('enable-openmp', type: 'boolean', value: true)
+
ml_api_common_dep,
libm_dep,
libdl_dep,
- thread_dep
+ thread_dep,
+ openmp_dep
]
if get_option('platform') == 'tizen'