| 192 | } |
| 193 | |
| 194 | Status CreateTensor(const CLContext& context, const CLDevice& device, int width, |
| 195 | int height, int channels, DataType data_type, |
| 196 | TensorStorageType storage_type, Tensor* result) { |
| 197 | CLMemory memory; |
| 198 | RETURN_IF_ERROR(AllocateTensorMemory(context, device, width, height, channels, |
| 199 | data_type, storage_type, &memory)); |
| 200 | *result = Tensor(memory.Release(), width, height, channels, data_type, |
| 201 | storage_type); |
| 202 | return OkStatus(); |
| 203 | } |
| 204 | |
| 205 | Status AllocateTensorMemory(const CLContext& context, const CLDevice& device, |
| 206 | int width, int height, int channels, |