47 #include "tiny_dnn/layers/layer.h"
49 #include "tiny_dnn/core/framework/program.h"
50 #include "tiny_dnn/core/framework/device.fwd.h"
52 #if defined(USE_OPENCL) || defined(USE_CUDA)
54 #include "third_party/CLCudaAPI/clpp11.h"
56 #include "third_party/CLCudaAPI/cupp11.h"
85 #if defined(USE_OPENCL) || defined(USE_CUDA)
87 layer.setDevice(device);
152 serial_size_t num_programs()
const {
153 #if defined(USE_OPENCL) || defined(USE_CUDA)
154 return programs_.size();
156 return serial_size_t(0);
162 #if defined(USE_OPENCL) || defined(USE_CUDA)
163 CLCudaAPI::Program program(
const Program& program) {
164 auto p = programs_.find(program);
165 if (p == programs_.end()) {
166 throw nn_error(
"Cannot retrieve program.");
174 #if defined(USE_OPENCL) || defined(USE_CUDA)
184 #if defined(USE_OPENCL) || defined(USE_CUDA)
186 std::unordered_map<Program, CLCudaAPI::Program, ProgramHash> programs_;
Definition: device.fwd.h:73
Definition: program_manager.h:66
base class of all kind of NN layers
Definition: layer.h:62
error exception class for tiny-dnn
Definition: nn_error.h:37