Hi, this is my first attempt at running CUDA on Android Flashed TK1.
I installed CodeWorksforAndroid.
I have both my .c and .cu files in /src directory of my Android project. Following is the Android.mk I am using:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
GCC=$(NDK_ROOT)/toolchains/arm-linux-androideabi-4.6/gen_standalone/linux-x86_64/bin/arm-linux-androideabi-g++
NVCC=$(CUDA_TOOLKIT_ROOT)/bin/nvcc -ccbin $(GCC) -target-cpu-arch=ARM -m32 -arch=sm_30 -O3 -Xptxas '-dlcm=ca' -target-os-variant=Android --use_fast_math
FILE_LIST := $(wildcard $(LOCAL_PATH)/src/*.cu) $(wildcard $(LOCAL_PATH)/src/*.c)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_CFLAGS := -O2 -g -W -Wall -Wall -Wfatal-errors -DGPU
LOCAL_LDFLAGS := -lm -pthread -lstdc++
LOCAL_C_EXTENSION := cu c
ARCH= --gpu-architecture=compute_20 --gpu-code=compute_20
LOCAL_C_INCLUDES := $(CUDA_TOOLKIT_ROOT)/targets/armv7-linux-androideabi/include -lcudart
LOCAL_MODULE := darknet
include $(BUILD_EXECUTABLE)
I am getting the following errors:
error: undefined reference to ‘cudaMalloc’
error: undefined reference to ‘cudaMalloc’
error: undefined reference to ‘cudaFree’
And the build system cant find reference to all the .cu files.
Can you please point to what flags I am missing?
Also if you could point to a resource/tutorials to build CUDA applications in Android tree, that would be very helpful.
Thank you