MCPcopy Create free account
hub / github.com/davisking/dlib / static_pointer_cast

Function static_pointer_cast

dlib/cuda/cuda_data_ptr.h:259–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258 template <typename T>
259 cuda_data_ptr<T> static_pointer_cast(const cuda_data_void_ptr &ptr)
260 {
261 DLIB_CASSERT(ptr.size() % sizeof(T) == 0,
262 "Size of memory buffer in ptr doesn't match sizeof(T). "
263 << "\nptr.size(): "<< ptr.size()
264 << "\nsizeof(T): "<< sizeof(T));
265 cuda_data_ptr<T> result;
266 result.pdata = ptr;
267 result.num = ptr.size() / sizeof(T);
268 return result;
269 }
270
271 template <typename T>
272 cuda_data_ptr<T> static_pointer_cast(const cuda_data_void_ptr &ptr, size_t num)

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected