all: init $(NAME) $(STATIC_NAME) examples
@echo $(CXX_OBJS)
-
-init:
+
+init:
@ mkdir -p $(foreach obj,$(OBJS),$(dir $(obj)))
@ mkdir -p $(foreach obj,$(EXAMPLE_OBJS),$(dir $(obj)))
@ mkdir -p $(foreach obj,$(TEST_OBJS),$(dir $(obj)))
- @ mkdir -p $(foreach obj,$(GTEST_OBJ),$(dir $(obj)))
+ @ mkdir -p $(foreach obj,$(GTEST_OBJ),$(dir $(obj)))
linecount: clean
cloc --read-lang-def=$(PROJECT).cloc src/$(PROJECT)/
$(CXX) -shared -o $(PY$(PROJECT)_SO) $(PY$(PROJECT)_SRC) \
$(STATIC_NAME) $(CXXFLAGS) $(PYTHON_LDFLAGS)
@echo
-
+
mat$(PROJECT): mat
mat: init $(STATIC_NAME) $(MAT$(PROJECT)_SRC)
CXXLIBS="\$$CXXLIBS $(LDFLAGS)" \
-o $(MAT$(PROJECT)_SO)
@echo
-
+
$(NAME): init $(PROTO_OBJS) $(OBJS)
$(CXX) -shared -o $(NAME) $(OBJS) $(LDFLAGS) $(WARNINGS)
@echo
$(BUILD_DIR)/src/$(PROJECT)/%.o: src/$(PROJECT)/%.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@ $(LDFLAGS)
@echo
-
+
$(BUILD_DIR)/src/$(PROJECT)/layers/%.o: src/$(PROJECT)/layers/%.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@ $(LDFLAGS)
@echo
-
+
$(BUILD_DIR)/src/$(PROJECT)/proto/%.o: src/$(PROJECT)/proto/%.cc
$(CXX) $< $(CXXFLAGS) -c -o $@ $(LDFLAGS)
@echo
-
+
$(BUILD_DIR)/src/$(PROJECT)/test/%.o: src/test/%.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@ $(LDFLAGS)
@echo
-
+
$(BUILD_DIR)/src/$(PROJECT)/util/%.o: src/$(PROJECT)/util/%.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@ $(LDFLAGS)
@echo
-
+
$(BUILD_DIR)/src/gtest/%.o: src/gtest/%.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@ $(LDFLAGS)
@echo
-
+
$(BUILD_DIR)/src/$(PROJECT)/layers/%.cuo: src/$(PROJECT)/layers/%.cu
$(CUDA_DIR)/bin/nvcc $(NVCCFLAGS) $(CUDA_ARCH) -c $< -o $@
@echo
-
+
$(BUILD_DIR)/src/$(PROJECT)/util/%.cuo: src/$(PROJECT)/util/%.cu
$(CUDA_DIR)/bin/nvcc $(NVCCFLAGS) $(CUDA_ARCH) -c $< -o $@
@echo
-
+
$(BUILD_DIR)/examples/%.o: examples/%.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@ $(LDFLAGS)
@echo
mkdir -p include/$(PROJECT)/proto
cp $(PROTO_GEN_HEADER) include/$(PROJECT)/proto/
@echo
-
+
clean:
@- $(RM) $(NAME) $(STATIC_NAME)
@- $(RM) $(PROTO_GEN_HEADER) $(PROTO_GEN_CC) $(PROTO_GEN_PY)
CXX=/usr/bin/g++
BUILD_DIR=build
-DISTRIBUTE_DIR=distribute
\ No newline at end of file
+DISTRIBUTE_DIR=distribute
n13052670 hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa
n13054560 bolete
n13133613 ear, spike, capitulum
-n15075141 toilet tissue, toilet paper, bathroom tissue
\ No newline at end of file
+n15075141 toilet tissue, toilet paper, bathroom tissue
// problem when running on a machine without GPU. Thus, we simply define
// these two functions for safety and possible future change if the problem
// of calling cuda functions disappears in a future version.
-//
+//
// In practice, although we are creating unpinned memory here, as long as we
// are constantly accessing them the memory pages almost always stays in
// the physical memory (assuming we have large enough memory installed), and
#include "caffe/test/test_caffe_main.hpp"
namespace caffe {
-
+
template <typename Dtype>
class BlobSimpleTest : public ::testing::Test {
protected:
namespace caffe {
extern cudaDeviceProp CAFFE_TEST_CUDA_PROP;
-
+
template <typename Dtype>
class FlattenLayerTest : public ::testing::Test {
protected:
namespace caffe {
extern cudaDeviceProp CAFFE_TEST_CUDA_PROP;
-
+
template <typename Dtype>
class Im2colLayerTest : public ::testing::Test {
protected:
namespace caffe {
extern cudaDeviceProp CAFFE_TEST_CUDA_PROP;
-
+
template <typename Dtype>
class LRNLayerTest : public ::testing::Test {
protected:
template <typename Dtype>
void LRNLayerTest<Dtype>::ReferenceLRNForward(
- const Blob<Dtype>& blob_bottom, const LayerParameter& layer_param,
+ const Blob<Dtype>& blob_bottom, const LayerParameter& layer_param,
Blob<Dtype>* blob_top) {
blob_top->Reshape(blob_bottom.num(), blob_bottom.channels(),
blob_bottom.height(), blob_bottom.width());
// std::cout << "CPU diff " << this->blob_bottom_->cpu_diff()[i] << std::endl;
//}
checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_);
-}
+}
TYPED_TEST(LRNLayerTest, TestGPUGradient) {
LayerParameter layer_param;
namespace caffe {
extern cudaDeviceProp CAFFE_TEST_CUDA_PROP;
-
+
template <typename Dtype>
class NeuronLayerTest : public ::testing::Test {
protected:
namespace caffe {
extern cudaDeviceProp CAFFE_TEST_CUDA_PROP;
-
+
template <typename Dtype>
class PaddingLayerTest : public ::testing::Test {
protected:
for (int i = 0; i < mem.size(); ++i) {
EXPECT_EQ(((char*)recovered_value)[i], 1);
}
- // do another round
+ // do another round
cpu_data = mem.mutable_cpu_data();
EXPECT_EQ(mem.head(), SyncedMemory::HEAD_AT_CPU);
memset(cpu_data, 2, mem.size());
EXPECT_EQ(((char*)cpu_data)[i], 1);
}
EXPECT_EQ(mem.head(), SyncedMemory::SYNCED);
-
+
gpu_data = mem.mutable_gpu_data();
EXPECT_EQ(mem.head(), SyncedMemory::HEAD_AT_GPU);
CUDA_CHECK(cudaMemset(gpu_data, 2, mem.size()));