Caffe2 - C++ API
A deep learning, cross platform ML framework
cuda_lazy_init.h
1 #pragma once
2 
3 // cuda_lazy_init() is always compiled, even for CPU-only builds.
4 // Thus, it does not live in the cuda/ folder.
5 
6 namespace torch {
7 namespace utils {
8 
9 // The INVARIANT is that this function MUST be called before you attempt
10 // to get a CUDA Type object from ATen, in any way. Here are some common
11 // ways that a Type object may be retrieved:
12 //
13 // - You call getNonVariableType or getNonVariableTypeOpt
14 // - You call toBackend() on a Type
15 //
16 // It's important to do this correctly, because if you forget to add it
17 // you'll get an oblique error message about "Cannot initialize CUDA without
18 // ATen_cuda library" if you try to use CUDA functionality from a CPU-only
19 // build, which is not good UX.
20 //
21 void cuda_lazy_init();
22 
23 }
24 }
Definition: jit_type.h:17