| 1299 | } |
| 1300 | |
| 1301 | inline CUdeviceptr get_global_ptr(const char* name, |
| 1302 | size_t* size = nullptr) const { |
| 1303 | CUdeviceptr global_ptr = 0; |
| 1304 | auto global = _global_map.find(name); |
| 1305 | if (global != _global_map.end()) { |
| 1306 | cuda_safe_call(cuModuleGetGlobal(&global_ptr, size, _module, |
| 1307 | global->second.c_str())); |
| 1308 | } else { |
| 1309 | throw std::runtime_error(std::string("failed to look up global ") + name); |
| 1310 | } |
| 1311 | return global_ptr; |
| 1312 | } |
| 1313 | |
| 1314 | template <typename T> |
| 1315 | inline CUresult get_global_data(const char* name, T* data, size_t count, |