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

Method get_handle

dlib/cuda/cublas_dlibapi.cpp:67–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 cublasHandle_t get_handle (
68 )
69 {
70 int new_device_id;
71 CHECK_CUDA(cudaGetDevice(&new_device_id));
72 // make room for more devices if needed
73 if (new_device_id >= (long)handles.size())
74 handles.resize(new_device_id+16);
75
76 // If we don't have a handle already for this device then make one
77 if (!handles[new_device_id])
78 CHECK_CUBLAS(cublasCreate(&handles[new_device_id]));
79
80 // Finally, return the handle for the current device
81 return handles[new_device_id];
82 }
83
84 private:
85

Callers 1

contextFunction · 0.45

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected