| 106 | |
| 107 | template <typename T> |
| 108 | std::unique_ptr<CudaArrayLayeredTexture<T>> |
| 109 | CudaArrayLayeredTexture<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(¶ms, 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(¶ms)); |
| 125 | |
| 126 | return array; |
| 127 | } |
| 128 | |
| 129 | template <typename T> |
| 130 | CudaArrayLayeredTexture<T>::CudaArrayLayeredTexture( |
nothing calls this directly
no outgoing calls
no test coverage detected