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

Method allocate

XM/include/Utils/memory.h:1027–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025 }
1026
1027 inline void allocate(const int gpu_id, const int size) {
1028 if (this->vals == nullptr) {
1029 this->gpu_id = gpu_id;
1030 this->size = size;
1031 CHECK_CUDA( cudaSetDevice(this->gpu_id) );
1032 CHECK_CUDA( cudaMalloc((void**) &this->vals, sizeof(int) * this->size) );
1033 }
1034 return;
1035 }
1036
1037 ~DeviceDnVecInt() {
1038 CHECK_CUDA( cudaSetDevice(this->gpu_id) );

Callers 1

DeviceDnVecIntMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected