| 128 | |
| 129 | template <typename T> |
| 130 | CudaArrayLayeredTexture<T>::CudaArrayLayeredTexture( |
| 131 | const cudaTextureDesc& texture_desc, |
| 132 | const size_t width, |
| 133 | const size_t height, |
| 134 | const size_t depth) |
| 135 | : texture_desc_(texture_desc), |
| 136 | width_(width), |
| 137 | height_(height), |
| 138 | depth_(depth) { |
| 139 | THROW_CHECK_GT(width_, 0); |
| 140 | THROW_CHECK_GT(height_, 0); |
| 141 | THROW_CHECK_GT(depth_, 0); |
| 142 | |
| 143 | cudaExtent extent = make_cudaExtent(width_, height_, depth_); |
| 144 | cudaChannelFormatDesc fmt = cudaCreateChannelDesc<T>(); |
| 145 | CUDA_SAFE_CALL(cudaMalloc3DArray(&array_, &fmt, extent, cudaArrayLayered)); |
| 146 | |
| 147 | memset(&resource_desc_, 0, sizeof(resource_desc_)); |
| 148 | resource_desc_.resType = cudaResourceTypeArray; |
| 149 | resource_desc_.res.array.array = array_; |
| 150 | |
| 151 | CUDA_SAFE_CALL(cudaCreateTextureObject( |
| 152 | &texture_, &resource_desc_, &texture_desc_, nullptr)); |
| 153 | } |
| 154 | |
| 155 | template <typename T> |
| 156 | CudaArrayLayeredTexture<T>::~CudaArrayLayeredTexture() { |
nothing calls this directly
no outgoing calls
no test coverage detected