[Beignet] [PATCH] Android.mk: update Android.mk for android build.

Pan, Xiuli xiuli.pan at intel.com
Thu Jan 19 09:28:15 UTC 2017


LGTM.

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Yang Rong
Sent: Thursday, January 19, 2017 5:39 PM
To: beignet at lists.freedesktop.org
Cc: Yang, Rong R <rong.r.yang at intel.com>
Subject: [Beignet] [PATCH] Android.mk: update Android.mk for android build.

---
 Android.common.mk             |  2 +-
 backend/src/Android.mk        | 11 +++++++++++
 backend/src/libocl/Android.mk |  1 -
 src/Android.mk                | 18 +++++++++++++++---
 4 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index dcb3c7c..60cd23b 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -2,7 +2,7 @@
 
 #include $(CLEAR_VARS)
 TOP_C_INCLUDE := bionic $(BEIGNET_ROOT_PATH)/include
-TOP_CPPFLAGS := -Wall -Wno-invalid-offsetof -mfpmath=sse -fno-rtti -Wcast-align -std=c++0x -msse2 -msse3 -mssse3 -msse4.1 -D__ANDROID__
+TOP_CPPFLAGS := -Wall -Wno-invalid-offsetof -mfpmath=sse -fno-rtti -Wcast-align -std=c++11 -msse2 -msse3 -mssse3 -msse4.1 -D__ANDROID__
 TOP_CFLAGS := -Wall -mfpmath=sse -msse2 -Wcast-align -msse2 -msse3 -mssse3 -msse4.1 -D__ANDROID__
 
 LLVM_INCLUDE_DIRS := external/llvm/device/include\
diff --git a/backend/src/Android.mk b/backend/src/Android.mk
index da4d787..47d4ea7 100644
--- a/backend/src/Android.mk
+++ b/backend/src/Android.mk
@@ -62,6 +62,8 @@ BACKEND_SRC_FILES:= \
     ir/immediate.cpp \
     ir/structurizer.hpp \
     ir/structurizer.cpp \
+    ir/reloc.hpp \
+    ir/reloc.cpp \
     backend/context.cpp \
     backend/context.hpp \
     backend/program.cpp \
@@ -80,6 +82,7 @@ BACKEND_SRC_FILES:= \
     llvm/PromoteIntegers.cpp \
     llvm/ExpandLargeIntegers.cpp \
     llvm/StripAttributes.cpp \
+    llvm/llvm_device_enqueue.cpp \
     llvm/llvm_to_gen.cpp \
     llvm/llvm_loadstore_optimization.cpp \
     llvm/llvm_gen_backend.hpp \
@@ -140,12 +143,16 @@ $(shell echo "  #define INTERP_OBJECT_DIR \"/system/lib64/libgbeinterp.so\"" >>
 $(shell echo "  #define OCL_BITCODE_BIN \"/system/lib/ocl/beignet.bc\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_HEADER_DIR \"/system/lib/ocl/include\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_PCH_OBJECT \"/system/lib/ocl/beignet.pch\"" >> $(gbe_config_file))
+$(shell echo "  #define OCL_BITCODE_BIN_20 \"/system/lib/ocl/beignet_20.bc\"" >> $(gbe_config_file))
+$(shell echo "  #define OCL_PCH_OBJECT_20 \"/system/lib/ocl/beigneti_20.pch\"" >> $(gbe_config_file))
 $(shell echo "#else /*__x86_64__*/" >> $(gbe_config_file))
 $(shell echo "  #define GBE_OBJECT_DIR \"/system/lib/libgbe.so\"" >> $(gbe_config_file))
 $(shell echo "  #define INTERP_OBJECT_DIR \"/system/lib/libgbeinterp.so\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_BITCODE_BIN \"/system/lib/ocl/beignet.bc\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_HEADER_DIR \"/system/lib/ocl/include\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_PCH_OBJECT \"/system/lib/ocl/beignet.pch\"" >> $(gbe_config_file))
+$(shell echo "  #define OCL_BITCODE_BIN_20 \"/system/lib/ocl/beignet_20.bc\"" >> $(gbe_config_file))
+$(shell echo "  #define OCL_PCH_OBJECT_20 \"/system/lib/ocl/beigneti_20.pch\"" >> $(gbe_config_file))
 $(shell echo "#endif" >> $(gbe_config_file))
 $(shell echo "#else /*__ANDROID__*/" >> $(gbe_config_file))
 $(shell echo "  #define GBE_OBJECT_DIR \"\"" >> $(gbe_config_file))
@@ -153,6 +160,8 @@ $(shell echo "  #define INTERP_OBJECT_DIR \"\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_BITCODE_BIN \"`pwd $(TOP)`/$(generated_path)\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_HEADER_DIR \"`pwd $(TOP)`/$(generated_path)/libocl/include\"" >> $(gbe_config_file))
 $(shell echo "  #define OCL_PCH_OBJECT \"`pwd $(TOP)`/$(generated_path)\"" >> $(gbe_config_file))
+$(shell echo "  #define OCL_BITCODE_BIN_20 \"`pwd $(TOP)`/$(generated_path)\"" >> $(gbe_config_file))
+$(shell echo "  #define OCL_PCH_OBJECT_20 \"`pwd $(TOP)`/$(generated_path)\"" >> $(gbe_config_file))
 $(shell echo "#endif" >> $(gbe_config_file))
 
 #Build HOST libgbe.so
@@ -162,6 +171,8 @@ LOCAL_C_INCLUDES := $(TOP_C_INCLUDE) \
                     $(LLVM_INCLUDE_DIRS)
 LOCAL_CPPFLAGS +=  $(LLVM_CFLAGS) -std=c++11 -fexceptions -DGBE_DEBUG=0 -DGBE_COMPILER_AVAILABLE=1 -DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND
 LOCAL_CFLAGS +=  $(LLVM_CFLAGS) -fexceptions -DGBE_DEBUG=0 -DGBE_COMPILER_AVAILABLE=1 -DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND
+LOCAL_CPPFLAGS += -Wno-extra-semi -Wno-gnu-anonymous-struct -Wno-nested-anon-types
+LOCAL_CFLAGS += -Wno-extra-semi -Wno-gnu-anonymous-struct -Wno-nested-anon-types
 LOCAL_LDLIBS += -lpthread -lm -ldl -lLLVM -lclang
 #LOCAL_STATIC_LIBRARIES := $(CLANG_MODULE_LIBS)
 LOCAL_SHARED_LIBRARIES := libclang
diff --git a/backend/src/libocl/Android.mk b/backend/src/libocl/Android.mk
index 8e45c12..08044af 100644
--- a/backend/src/libocl/Android.mk
+++ b/backend/src/libocl/Android.mk
@@ -86,4 +86,3 @@ $(shell $(HOST_OUT)/bin/llvm-link -o ${generated_sources}/../beignet.bc $(addpre
 
 $(shell $(HOST_OUT)/bin/clang -cc1 ${CLANG_OCL_FLAGS} -triple spir -I ${generated_sources}/include/ --relocatable-pch -emit-pch -isysroot ${generated_sources} -x cl ${generated_sources}/include/ocl.h -o ${generated_sources}/../beignet.pch)
 
-
diff --git a/src/Android.mk b/src/Android.mk
index 9b63f7e..c195988 100644
--- a/src/Android.mk
+++ b/src/Android.mk
@@ -84,12 +84,23 @@ $(shell $(LOCAL_PATH)/git_sha1.sh $(LOCAL_PATH) ${GIT_SHA1})
 LOCAL_SRC_FILES:= \
     $(addprefix kernels/,$(addsuffix _str.c, $(KERNEL_NAMES))) \
     $(addprefix kernels/,$(addsuffix _str.c, $(BUILT_IN_NAME))) \
+    cl_base_object.c \
     cl_api.c \
+    cl_api_platform_id.c \
+    cl_api_device_id.c \
+    cl_api_mem.c \
+    cl_api_kernel.c \
+    cl_api_command_queue.c \
+    cl_api_event.c \
+    cl_api_context.c \
+    cl_api_sampler.c \
+    cl_api_program.c \
     cl_alloc.c \
     cl_kernel.c \
     cl_program.c \
     cl_gbe_loader.cpp \
     cl_sampler.c \
+    cl_accelerator_intel.c \
     cl_event.c \
     cl_enqueue.c \
     cl_image.c \
@@ -101,15 +112,16 @@ LOCAL_SRC_FILES:= \
     cl_command_queue.c \
     cl_command_queue.h \
     cl_command_queue_gen7.c \
-    cl_thread.c \
+    cl_command_queue_enqueue.c \
+    cl_device_enqueue.c \
+    cl_utils.c \
     cl_driver.h \
     cl_driver.cpp \
     cl_driver_defs.c \
     intel/intel_gpgpu.c \
     intel/intel_batchbuffer.c \
     intel/intel_driver.c \
-    performance.c \
-    cl_accelerator_intel.c
+    performance.c
 
 LOCAL_SHARED_LIBRARIES := \
 libgbe \
-- 
2.1.4

_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list