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

Method AllocateInternalObject

tensorflow/lite/delegates/gpu/gl/runtime.cc:243–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243Status Runtime::AllocateInternalObject(const Object& object) {
244 const ObjectRef ref = GetRef(object);
245 switch (object.object_type) {
246 case ObjectType::BUFFER: {
247 GlBuffer gl_buffer;
248 RETURN_IF_ERROR(CreateReadWriteShaderStorageBuffer<uint8_t>(
249 ByteSizeOf(object), &gl_buffer));
250 RETURN_IF_ERROR(
251 internal_objects_.RegisterBuffer(ref, std::move(gl_buffer)));
252 break;
253 }
254 case ObjectType::TEXTURE: {
255 GlTexture gl_texture;
256 RETURN_IF_ERROR(MakeGlTextureRef(object, &gl_texture));
257 RETURN_IF_ERROR(
258 internal_objects_.RegisterTexture(ref, std::move(gl_texture)));
259 break;
260 }
261 default:
262 return InternalError("Unexpected internal object type");
263 }
264 return OkStatus();
265}
266
267Status Runtime::AllocateConstObject(const Object& object, uint32_t* id) {
268 const ObjectData* data = GetData(object);

Callers

nothing calls this directly

Calls 7

GetRefFunction · 0.85
MakeGlTextureRefFunction · 0.85
OkStatusFunction · 0.85
RegisterTextureMethod · 0.80
ByteSizeOfFunction · 0.70
InternalErrorFunction · 0.50
RegisterBufferMethod · 0.45

Tested by

no test coverage detected