MCPcopy Create free account
hub / github.com/BVLC/caffe / StartInternalThread

Method StartInternalThread

src/caffe/internal_thread.cpp:21–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void InternalThread::StartInternalThread() {
22 CHECK(!is_started()) << "Threads should persist and not be restarted.";
23
24 int device = 0;
25#ifndef CPU_ONLY
26 CUDA_CHECK(cudaGetDevice(&device));
27#endif
28 Caffe::Brew mode = Caffe::mode();
29 int rand_seed = caffe_rng_rand();
30 int solver_count = Caffe::solver_count();
31 int solver_rank = Caffe::solver_rank();
32 bool multiprocess = Caffe::multiprocess();
33
34 try {
35 thread_.reset(new boost::thread(&InternalThread::entry, this, device, mode,
36 rand_seed, solver_count, solver_rank, multiprocess));
37 } catch (std::exception& e) {
38 LOG(FATAL) << "Thread exception: " << e.what();
39 }
40}
41
42void InternalThread::entry(int device, Caffe::Brew mode, int rand_seed,
43 int solver_count, int solver_rank, bool multiprocess) {

Callers 2

RunMethod · 0.80
TEST_FFunction · 0.80

Calls 2

caffe_rng_randFunction · 0.85
resetMethod · 0.45

Tested by 1

TEST_FFunction · 0.64