INCLUDE_DIRS := . $(CUDA_INCLUDE_DIR)
LIBRARY_DIRS := . $(CUDA_LIB_DIR)
-LIBRARIES := cuda cudart cublas protobuf
+LIBRARIES := cuda cudart cublas protobuf glog
WARNINGS := -Wall
CXXFLAGS += -fPIC $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir))
#include <iostream>
#include <boost/shared_ptr.hpp>
+#include <glog/logging.h>
#include "driver_types.h"
static std::ostream nullout(0);
-// TODO(Yangqing): make a better logging scheme
-#define LOG_IF(condition) \
- !(condition) ? nullout : std::cout
-
-#define CHECK(condition) \
- LOG_IF(condition) << "Check failed: " #condition " "
-
-#ifndef NDEBUG
-
-#define DCHECK(condition) CHECK(condition)
-
-#else
-
-#define DCHECK(condition)
-
-#endif // NDEBUG
-
-
#define CUDA_CHECK(condition) \
- CUDA_LOG_IF(condition) << "Check failed: " #condition " "
-
-
-// TODO(Yangqing): make a better logging scheme
-#define CUDA_LOG_IF(condition) \
- ((condition) == cudaSuccess) ? nullout : std::cout
-
-#define CUDA_CHECK(condition) \
- CUDA_LOG_IF(condition) << "Check failed: " #condition " "
-
-#ifndef NDEBUG
-
-#define CUDA_DCHECK(condition) CUDA_CHECK(condition)
-
-#else
-
-#define CUDA_DCHECK(condition)
-
-#endif // NDEBUG
+ CHECK((condition) == cudaSuccess)
#endif // CAFFEINE_COMMON_HPP_