MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / WriteData

Method WriteData

tensorflow/lite/delegates/gpu/cl/texture2d.h:85–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84template <typename T>
85Status Texture2D::WriteData(CLCommandQueue* queue, const absl::Span<T> data) {
86 const int element_size = ChannelTypeToSizeInBytes(channel_type_);
87 if (sizeof(T) % element_size != 0) {
88 return InvalidArgumentError(
89 "Template type T has not suitable element type for created texture.");
90 }
91 if (4 * width_ * height_ * element_size != data.size() * sizeof(T)) {
92 return InvalidArgumentError(
93 "absl::Span<T> data size is different from texture allocated size.");
94 }
95
96 RETURN_IF_ERROR(queue->EnqueueWriteImage(texture_, int3(width_, height_, 1),
97 data.data()));
98
99 return OkStatus();
100}
101
102template <typename T>
103Status Texture2D::ReadData(CLCommandQueue* queue,

Callers

nothing calls this directly

Calls 6

ChannelTypeToSizeInBytesFunction · 0.85
OkStatusFunction · 0.85
EnqueueWriteImageMethod · 0.80
InvalidArgumentErrorFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected