MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / allocate

Method allocate

XM/include/Utils/memory.h:1059–1067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057 }
1058
1059 inline void allocate(const int gpu_id, const int size) {
1060 if (this->vals == nullptr) {
1061 this->gpu_id = gpu_id;
1062 this->size = size;
1063 CHECK_CUDA( cudaSetDevice(this->gpu_id) );
1064 CHECK_CUDA( cudaMalloc((void**) &this->vals, sizeof(size_t) * this->size) );
1065 }
1066 return;
1067 }
1068
1069 ~DeviceDnVecLongInt() {
1070 CHECK_CUDA( cudaSetDevice(this->gpu_id) );

Callers 1

DeviceDnVecLongIntMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected