APP_STL := gnustl_static
APP_ABI := armeabi-v7a
NDK_TOOLCHAIN_VERSION := 4.9
#set the APP_PLATFORM to match your platform version.
APP_PLATFORM := android-18
# vim Android.mkLOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
SYMPHONY_VERSION := 1.1.0
SYMPHONY_LIB_TYPE := release-cpu
include $(LOCAL_PATH)/lib/SYMPHONY.mk
工程目录下的目录文件包括: Android.mk、Application.mk、include和lib;#include
#include
int main()
{
// initialize the input vector
std::vector vin(1024, 0);
// in-place update of the input vector
// equivalent to the following code
// for (size_t i = 0; i < vin.size(); ++i) {
// vin[i] = 2 * i;
// }
symphony::pfor_each(size_t(0), vin.size(), [&vin](size_t i) {
vin[i] = 2 * i;
});
return 0;
}
# vim Android.mk
添加后的代码如下:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
SYMPHONY_VERSION := 1.1.0
SYMPHONY_LIB_TYPE := release-cpu
include $(LOCAL_PATH)/lib/SYMPHONY.mk
################################################
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
LOCAL_ARM_NEON := true
endif
LOCAL_MODULE := pfor_helloworld
LOCAL_CPP_FEATURES := exceptions
LOCAL_SHARED_LIBRARIES := libsymphony
LOCAL_SRC_FILES := pfor_helloworld.cc
include $(BUILD_EXECUTABLE)
4. 编译代码