MCPcopy Create free account
hub / github.com/colmap/colmap / FromHostArray

Method FromHostArray

src/colmap/mvs/cuda_texture.h:108–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107template <typename T>
108std::unique_ptr<CudaArrayLayeredTexture<T>>
109CudaArrayLayeredTexture<T>::FromHostArray(const cudaTextureDesc& texture_desc,
110 const size_t width,
111 const size_t height,
112 const size_t depth,
113 const T* data) {
114 auto array = std::make_unique<CudaArrayLayeredTexture<T>>(
115 texture_desc, width, height, depth);
116
117 cudaMemcpy3DParms params;
118 memset(&params, 0, sizeof(params));
119 params.extent = make_cudaExtent(width, height, depth);
120 params.kind = cudaMemcpyHostToDevice;
121 params.srcPtr =
122 make_cudaPitchedPtr((void*)data, width * sizeof(T), width, height);
123 params.dstArray = array->array_;
124 CUDA_SAFE_CALL(cudaMemcpy3D(&params));
125
126 return array;
127}
128
129template <typename T>
130CudaArrayLayeredTexture<T>::CudaArrayLayeredTexture(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected