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

Method copy

XM/include/Utils/memory.h:348–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346 }
347
348 void copy(const DeviceDnTen<T>& other){
349 gpu_id = other.gpu_id;
350 num_dims = other.num_dims;
351 total_size = other.total_size;
352
353 // TODO: here we need more safe code
354 this->dimensions = (size_s*)malloc(sizeof(size_s) * num_dims);
355 std::memcpy(dimensions, other.dimensions, sizeof(size_s) * num_dims);
356
357 this->allocate();
358 CHECK_CUDA(cudaDeviceSynchronize());
359 cudaMemcpy(vals, other.vals, sizeof(T) * total_size, cudaMemcpyDeviceToDevice);
360 CHECK_CUDA(cudaDeviceSynchronize());
361 }
362
363 inline void allocate() {
364

Callers 8

4_test_unidepth.pyFile · 0.80
5_test_ceres.pyFile · 0.80
checklandmarksFunction · 0.80
XM_Ceres_interfaceFunction · 0.80
create_matrixFunction · 0.80
optimizeMethod · 0.80

Calls 1

allocateMethod · 0.95

Tested by

no test coverage detected