index 7362b233780d7d205906df1e53bbab2950e86fa5..af42772bac43951a2861892e1dfd5d4b57ce355e 100644 (file)
--- a/include/caffe/common.hpp
+++ b/include/caffe/common.hpp
// Returns the phase: TRAIN or TEST.
inline static Phase phase() { return Get().phase_; }
// The setters for the variables
// Returns the phase: TRAIN or TEST.
inline static Phase phase() { return Get().phase_; }
// The setters for the variables
- // Sets the mode.
+ // Sets the mode. It is recommended that you don't change the mode halfway
+ // into the program since that may cause allocation of pinned memory being
+ // freed in a non-pinned way, which may cause problems - I haven't verified
+ // it personally but better to note it here in the header file.
inline static void set_mode(Brew mode) { Get().mode_ = mode; }
// Sets the phase.
inline static void set_phase(Phase phase) { Get().phase_ = phase; }
// Sets the random seed of both MKL and curand
static void set_random_seed(const unsigned int seed);
inline static void set_mode(Brew mode) { Get().mode_ = mode; }
// Sets the phase.
inline static void set_phase(Phase phase) { Get().phase_ = phase; }
// Sets the random seed of both MKL and curand
static void set_random_seed(const unsigned int seed);
+ // Sets the device. Since we have cublas and curand stuff, set device also
+ // requires us to reset those values.
+ static void SetDevice(const int device_id);
// Prints the current GPU status.
static void DeviceQuery();
// Prints the current GPU status.
static void DeviceQuery();