Skip to content

Commit

Permalink
add psmain
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Jan 20, 2015
1 parent 239c248 commit 7198279
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export NVCCFLAGS = --use_fast_math -g -O3 -ccbin $(CXX)

# specify tensor path
BIN = bin/cxxnet
OBJ = layer_cpu.o updater_cpu.o nnet_cpu.o data.o
OBJ = layer_cpu.o updater_cpu.o nnet_cpu.o data.o main.o
CUOBJ = layer_gpu.o updater_gpu.o nnet_gpu.o
CUBIN =
.PHONY: clean all
Expand All @@ -48,11 +48,13 @@ layer_cpu.o layer_gpu.o: src/layer/layer_impl.cpp src/layer/layer_impl.cu src/la
updater_cpu.o updater_gpu.o: src/updater/updater_impl.cpp src/updater/updater_impl.cu src/layer/layer.h src/updater/*.hpp src/updater/*.h src/utils/*.h
nnet_cpu.o nnet_gpu.o: src/nnet/nnet_impl.cpp src/nnet/nnet_impl.cu src/layer/layer.h src/updater/updater.h src/utils/*.h src/nnet/*.hpp src/nnet/*.h
data.o: src/io/data.cpp src/io/*.hpp
main.o: src/cxxnet_main.cpp

bin/cxxnet: src/cxxnet_main.cpp $(OBJ) $(CUOBJ)
bin/cxxnet: src/local_main.cpp $(OBJ) $(CUOBJ)
bin/cxxnet.ps: $(OBJ) $(CUOBJ) libps.a libps_main.a

$(BIN) :
$(CXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c, $^) $(LDFLAGS)
$(CXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.a, $^) $(LDFLAGS)

$(OBJ) :
$(CXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c, $^) )
Expand Down
2 changes: 2 additions & 0 deletions example/MNIST/MNIST.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ iter = mnist
path_img = "./data/train-images-idx3-ubyte.gz"
path_label = "./data/train-labels-idx1-ubyte.gz"
shuffle = 1
iter = membuffer
max_nbatch = 100
iter = end
# evaluation iterator
eval = test
Expand Down
3 changes: 2 additions & 1 deletion src/cxxnet_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ class CXXNetLearnTask {
};
} // namespace cxxnet

int main(int argc, char *argv[]) {
// general main for PS
int PSMain(int argc, char *argv[]) {
cxxnet::CXXNetLearnTask tsk;
return tsk.Run(argc, argv);
}
10 changes: 10 additions & 0 deletions src/local_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*!
* \file local_main.cpp
* \brief local main file that redirect directly to PSMain
* \author Tianqi Chen
*/
int PSMain(int argc, char *argv[]);

int main(int argc, char *argv[]) {
return PSMain(argc, argv);
}

0 comments on commit 7198279

Please sign in to comment.