Skip to content

Commit

Permalink
Merged source into project tree
Browse files Browse the repository at this point in the history
  • Loading branch information
jetpaccomputer committed Jul 22, 2014
2 parents 62faa3a + e961fa1 commit cf0590f
Show file tree
Hide file tree
Showing 102 changed files with 29,554 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.o
data/example_networks/imagenet.ntwk
26 changes: 26 additions & 0 deletions source/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
LIBSRCS:=$(shell find src/lib -name '*.cpp')
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(LIBSRCS)
LOCAL_MODULE := jpcnn

LOCAL_C_INCLUDES += ./src/lib/include \
./src/lib/graph \
./src/lib/math \
./src/lib/third_party \
./src/lib/utility \
./src/lib/svm \
./src/lib/opengl \
./src/lib \
./src/include \
../eigen \
/Users/petewarden/android_ndk/sources/cxx-stl/gnu-libstdc++/4.6/include \
/Users/petewarden/android_ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include

LOCAL_CFLAGS := -DUSE_EIGEN_GEMM -DUSE_NEON
LOCAL_CFLAGS += -mfloat-abi=softfp -mfpu=neon -march=armv7

LOCAL_CFLAGS += -fopenmp -O3
LOCAL_LDFLAGS += -fopenmp -llog

include $(BUILD_SHARED_LIBRARY)
11 changes: 11 additions & 0 deletions source/DeepBelief/DeepBelief.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// DeepBelief.h
// DeepBelief
//
// Created by Peter Warden on 4/2/14.
// Copyright (c) 2014 Jetpac, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

#include "libjpcnn.h"
95 changes: 95 additions & 0 deletions source/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
CC=gcc
CXX=g++
RM=rm -f
CPPFLAGS=

.PRECIOUS: %.cdat

LIBCPPFLAGS=-Ofast -I ./src/lib/include -I ./src/lib/graph -I ./src/lib/math -I ./src/lib/third_party -I ./src/lib/utility -I ./src/lib/svm -I ./src/lib/opengl -I ./src/lib -I ./src/include
LIBLDFLAG=
LIBLDLIBS=

$(warning GEMM=$(GEMM))
$(warning TARGET=$(TARGET))

LIBSRCS := $(shell find src/lib -name '*.cpp' -not -name '._*')
LIBOBJS := $(subst .cpp,.o,$(LIBSRCS))

ifeq ($(GEMM),mkl)
MKLROOT = /opt/intel/composer_xe_2013_sp1.0.080/mkl
LIBCPPFLAGS += -fopenmp -DMKL_ILP64 -m64 -I$(MKLROOT)/include -DUSE_MKL_GEMM=1
LIBLDLIBS += -Wl,--start-group /opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64/libmkl_intel_ilp64.a /opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64/libmkl_gnu_thread.a /opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -ldl -lpthread -lm
LIBLDLIBS += -L/usr/lib/gcc/x86_64-linux-gnu/4.6/ -lgomp
endif

ifeq ($(GEMM),atlas)
LIBCPPFLAGS += -I/usr/include -DUSE_ATLAS_GEMM=1
LIBLDLIBS += -lblas
endif

ifeq ($(GEMM),eigen)
LIBCPPFLAGS += -I../eigen -DUSE_EIGEN_GEMM=1
endif

ifeq ($(TARGET),pi)
LIBCPPFLAGS += \
-DTARGET_PI \
-march=armv6 \
-mfloat-abi=hard \
-ftree-vectorize \
-funroll-all-loops \
-mfpu=vfp \
-I./src/lib/pi
endif

ifeq ($(GEMM),pigl)
LIBCPPFLAGS += \
-I/usr/include \
-I/opt/vc/include/ \
-I/opt/vc/include/interface/vcos/pthreads/ \
-I/opt/vc/include/interface/vmcs_host/linux/ \
-DUSE_GL_GEMM \
-DUSE_OPENGL \
-DTARGET_PI \
-DDEBUG
LIBLDLIBS += -lblas -L/opt/vc/lib -lGLESv2 -lEGL -lopenmaxil -lbcm_host
endif

ifeq ($(GEMM),piqpu)
LIBCPPFLAGS += -DUSE_QPU_GEMM -g
ASMSRCS := ./src/lib/pi/gemm_float.asm ./src/lib/pi/gemm_8bit.asm ./src/lib/pi/gemm_16bit.asm
ASMINTERMEDIATES := $(subst .asm,.cdat,$(ASMSRCS))
ASMOBJS := $(subst .asm,.do,$(ASMSRCS))
LIBOBJS += $(ASMOBJS)
endif

TOOLCPPFLAGS := -O3 -I ./src/include

TOOLSRCS := $(shell find src/tool -name '*.cpp' -not -name '._*')
TOOLOBJS := $(subst .cpp,.o,$(TOOLSRCS))

all: jpcnn

%.cdat: %.asm
m4 -I ./src/lib/pi/ $< | qpu-asm -o $(basename $@).cdat -c g_$(notdir $(basename $@))Code

%.do: %.cdat
$(CXX) $(CPPFLAGS) -x c -c $< -o $(basename $@).do

libjpcnn.so: CPPFLAGS=$(LIBCPPFLAGS)
libjpcnn.so: $(LIBOBJS)
g++ -shared $(LIBLDFLAGS) -o libjpcnn.so $(LIBOBJS) $(LIBLDLIBS)

main.o: src/tool/main.cpp
$(CXX) $(CPPFLAGS) -c src/tool/main.cpp -o main.o

jpcnn: CPPFLAGS=$(TOOLCPPFLAGS)
jpcnn: libjpcnn.so $(TOOLOBJS)
g++ -o jpcnn $(TOOLOBJS) -L. -ljpcnn

%.o: %.cpp
$(CXX) $(CPPFLAGS) -fPIC -c $< -o $(basename $@).o

clean:
find . -iname "*.o" -exec rm '{}' ';'
find . -iname "*.do" -exec rm '{}' ';'
11 changes: 11 additions & 0 deletions source/OSXDeepBelief/DeepBelief.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// DeepBelief.h
// DeepBelief
//
// Created by Peter Warden on 4/2/14.
// Copyright (c) 2014 Jetpac, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

#include "libjpcnn.h"
30 changes: 30 additions & 0 deletions source/OSXDeepBelief/OSXDeepBelief-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.jetpac.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>DeepBelief</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014 Jetpac, Inc. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
2 changes: 2 additions & 0 deletions source/OSXDeepBelief/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

1 change: 1 addition & 0 deletions source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ndk-build V=1 NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk && cp libs/armeabi/libjpcnn.so ~/projects/DeepBeliefSDK/examples/AndroidExample/libs/armeabi/
Binary file added source/data/dog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/data/lena.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cf0590f

Please sign in to comment.