Home
last modified time | relevance | path

Searched refs:usage_records (Results 1 – 18 of 18) sorted by relevance

/external/tensorflow/tensorflow/lite/delegates/gpu/common/
Dmemory_management.cc63 const std::vector<TensorUsageRecord<size_t>>& usage_records, in BestGreedy() argument
66 GreedyBySizeDistPriorityAssignment(usage_records, assignment)); in BestGreedy()
68 if (GreedyByBreadthAssignment(usage_records, &assignment_by_breadth).ok() && in BestGreedy()
77 const std::vector<TensorUsageRecord<size_t>>& usage_records, in AssignObjectsToTensors() argument
82 return NaiveAssignment(usage_records, assignment); in AssignObjectsToTensors()
84 return EqualityAssignmentWithHash(usage_records, assignment); in AssignObjectsToTensors()
86 return GreedyInOrderAssignment(usage_records, assignment, in AssignObjectsToTensors()
89 return GreedyByBreadthAssignment(usage_records, assignment); in AssignObjectsToTensors()
91 return GreedyBySizeDistPriorityAssignment(usage_records, assignment); in AssignObjectsToTensors()
93 return BestGreedy(usage_records, assignment); in AssignObjectsToTensors()
[all …]
Dmemory_management_test.cc108 std::vector<TensorUsageRecord<size_t>> usage_records{ in TEST() local
113 AssignObjectsToTensors(usage_records, MemoryStrategy::NAIVE, &assignment) in TEST()
118 ASSERT_TRUE(AssignObjectsToTensors(usage_records, MemoryStrategy::EQUALITY, in TEST()
125 usage_records, MemoryStrategy::GREEDY_IN_ORDER, &assignment) in TEST()
130 ASSERT_TRUE(AssignObjectsToTensors(usage_records, MemoryStrategy::MINCOSTFLOW, in TEST()
137 usage_records, MemoryStrategy::GREEDY_BY_BREADTH, &assignment) in TEST()
143 usage_records, MemoryStrategy::GREEDY_BY_SIZE, &assignment) in TEST()
149 ASSERT_TRUE(AssignOffsetsToTensors(usage_records, in TEST()
158 std::vector<TensorUsageRecord<size_t>> usage_records{ in TEST() local
168 AssignObjectsToTensors(usage_records, MemoryStrategy::NAIVE, &assignment) in TEST()
[all …]
Dmemory_management.h79 const std::vector<TensorUsageRecord<size_t>>& usage_records,
91 const std::vector<TensorUsageRecord<TensorSizeT>>& usage_records,
96 return NaiveAssignment(usage_records, assignment);
98 return EqualityAssignment(usage_records, assignment);
108 const std::vector<TensorUsageRecord<size_t>>& usage_records,
114 const std::vector<TensorUsageRecord<BHWC>>& usage_records,
120 const std::vector<TensorUsageRecord<uint2>>& usage_records,
126 const std::vector<TensorUsageRecord<uint3>>& usage_records,
133 const std::vector<TensorUsageRecord<size_t>>& usage_records,
/external/tensorflow/tensorflow/lite/delegates/gpu/common/memory_management/
Dgreedy_by_size_assignment.cc69 const std::vector<TensorUsageRecord<size_t>>& usage_records, in GreedyBySizeAssignment() argument
71 const size_t num_tensors = usage_records.size(); in GreedyBySizeAssignment()
78 ordered_records.emplace_back(&usage_records[i], i); in GreedyBySizeAssignment()
91 if (usage_records[allocated_id].last_task < rec->first_task || in GreedyBySizeAssignment()
92 usage_records[allocated_id].first_task > rec->last_task) { in GreedyBySizeAssignment()
109 prev_offset, cur_offset + usage_records[allocated_id].tensor_size); in GreedyBySizeAssignment()
161 const std::vector<TensorUsageRecord<size_t>>& usage_records, in GreedyBySizeDistPriorityAssignment() argument
164 CalculatePositionalMaximums(usage_records); in GreedyBySizeDistPriorityAssignment()
166 size_t num_records = usage_records.size(); in GreedyBySizeDistPriorityAssignment()
168 for (size_t rec_id = 0; rec_id < usage_records.size(); ++rec_id) { in GreedyBySizeDistPriorityAssignment()
[all …]
Dequality_assignment.h36 const std::vector<TensorUsageRecord<TensorSizeT>>& usage_records, in EqualityAssignmentWithHash() argument
38 size_t num_records = usage_records.size(); in EqualityAssignmentWithHash()
51 objects_in_use.top().last_task < usage_records[i].first_task) { in EqualityAssignmentWithHash()
57 const TensorSizeT tensor_size = usage_records[i].tensor_size; in EqualityAssignmentWithHash()
65 {usage_records[i].last_task, assignment->object_ids[i]}); in EqualityAssignmentWithHash()
72 {usage_records[i].last_task, assignment->object_ids[i]}); in EqualityAssignmentWithHash()
81 const std::vector<TensorUsageRecord<TensorSizeT>>& usage_records, in EqualityAssignment() argument
83 size_t num_records = usage_records.size(); in EqualityAssignment()
91 const TensorSizeT tensor_size = usage_records[i].tensor_size; in EqualityAssignment()
96 if (dealloc_task[obj] < usage_records[i].first_task && in EqualityAssignment()
[all …]
Dinternal_test.cc39 std::vector<TensorUsageRecord<size_t>> usage_records{ in TEST() local
42 std::vector<TaskProfile> task_profiles = CalculateTaskProfiles(usage_records); in TEST()
48 &usage_records[correct_idx[i][j]]); in TEST()
53 CalculatePositionalMaximums(usage_records); in TEST()
58 std::vector<TensorUsageRecord<size_t>> usage_records{ in TEST() local
67 std::vector<TaskProfile> task_profiles = CalculateTaskProfiles(usage_records); in TEST()
73 &usage_records[correct_idx[i][j]]); in TEST()
78 CalculatePositionalMaximums(usage_records); in TEST()
83 std::vector<TensorUsageRecord<size_t>> usage_records{ in TEST() local
96 std::vector<TaskProfile> task_profiles = CalculateTaskProfiles(usage_records); in TEST()
[all …]
Dmin_cost_flow_assignment.cc38 void Build(const std::vector<TensorUsageRecord<size_t>>& usage_records) { in Build() argument
39 usage_records_ = &usage_records; in Build()
40 num_tensors_ = usage_records.size(); in Build()
46 for (size_t i = 0; i < usage_records.size(); i++) { in Build()
50 objects_in_use.top().last_task < usage_records[i].first_task) { in Build()
54 objects_in_use.push({usage_records[i].last_task, i}); in Build()
61 AddEdge(source_, RightPartTwin(i), 1, usage_records[i].tensor_size); in Build()
70 if (usage_records[i].tensor_size > in Build()
71 usage_records[record_id].tensor_size) { in Build()
72 cost = usage_records[i].tensor_size - in Build()
[all …]
Dgreedy_in_order_assignment.h54 const std::vector<TensorUsageRecord<TensorSizeT>>& usage_records,
58 size_t num_records = usage_records.size();
72 objects_in_use.top().last_task < usage_records[i].first_task) {
77 TensorSizeT tensor_size = usage_records[i].tensor_size;
130 {usage_records[i].last_task, assignment->object_ids[i]});
139 {usage_records[i].last_task, assignment->object_ids[i]});
150 const std::vector<TensorUsageRecord<TensorSizeT>>& usage_records, in GreedyInOrderAssignmentMultidimensional() argument
152 size_t num_records = usage_records.size(); in GreedyInOrderAssignmentMultidimensional()
166 objects_in_use.top().last_task < usage_records[i].first_task) { in GreedyInOrderAssignmentMultidimensional()
171 const TensorSizeT& tensor_size = usage_records[i].tensor_size; in GreedyInOrderAssignmentMultidimensional()
[all …]
Dinternal.cc65 const std::vector<TensorUsageRecord<size_t>>& usage_records) { in CalculateTaskProfiles() argument
67 for (size_t i = 0; i < usage_records.size(); ++i) { in CalculateTaskProfiles()
68 num_tasks = std::max(num_tasks, usage_records[i].last_task + 1); in CalculateTaskProfiles()
71 for (size_t rec_id = 0; rec_id < usage_records.size(); ++rec_id) { in CalculateTaskProfiles()
74 for (TaskId task_id = usage_records[rec_id].first_task; in CalculateTaskProfiles()
75 task_id <= usage_records[rec_id].last_task; ++task_id) { in CalculateTaskProfiles()
76 task_profiles[task_id].emplace_back(&usage_records[rec_id], rec_id); in CalculateTaskProfiles()
88 const std::vector<TensorUsageRecord<size_t>>& usage_records) { in CalculatePositionalMaximums() argument
89 std::vector<TaskProfile> task_profiles = CalculateTaskProfiles(usage_records); in CalculatePositionalMaximums()
Dnaive_assignment.h36 const std::vector<TensorUsageRecord<TensorSizeT>>& usage_records, in NaiveAssignment() argument
38 assignment->object_sizes.resize(usage_records.size()); in NaiveAssignment()
39 assignment->object_ids.assign(usage_records.size(), kNotAssigned); in NaiveAssignment()
40 for (size_t i = 0; i < usage_records.size(); i++) { in NaiveAssignment()
41 auto& record = usage_records[i]; in NaiveAssignment()
Dgreedy_by_size_assignment.h44 const std::vector<TensorUsageRecord<size_t>>& usage_records,
72 const std::vector<TensorUsageRecord<size_t>>& usage_records,
Dgreedy_by_breadth_assignment.cc51 const std::vector<TensorUsageRecord<size_t>>& usage_records, in GreedyByBreadthAssignment() argument
53 std::vector<TaskProfile> task_profiles = CalculateTaskProfiles(usage_records); in GreedyByBreadthAssignment()
66 assignment->object_ids.assign(usage_records.size(), kNotAssigned); in GreedyByBreadthAssignment()
Dinternal.h100 const std::vector<TensorUsageRecord<size_t>>& usage_records);
104 const std::vector<TensorUsageRecord<size_t>>& usage_records);
Dgreedy_by_breadth_assignment.h49 const std::vector<TensorUsageRecord<size_t>>& usage_records,
Dmin_cost_flow_assignment.h36 const std::vector<TensorUsageRecord<size_t>>& usage_records,
/external/tensorflow/tensorflow/lite/delegates/gpu/gl/
Druntime.cc419 auto& usage_ref = usage_records->usage_refs[object_ref]; in operator ()()
421 usage_ref = usage_records->textures_3d.size(); in operator ()()
422 usage_records->textures_3d.emplace_back(/*tensor_size=*/size, in operator ()()
426 UpdateUsageRecord(&usage_records->textures_3d[usage_ref], program_id); in operator ()()
431 auto& usage_ref = usage_records->usage_refs[object_ref]; in operator ()()
433 usage_ref = usage_records->textures_2d.size(); in operator ()()
434 usage_records->textures_2d.emplace_back(/*tensor_size=*/size, in operator ()()
438 UpdateUsageRecord(&usage_records->textures_2d[usage_ref], program_id); in operator ()()
443 auto& usage_ref = usage_records->usage_refs[object_ref]; in operator ()()
445 usage_ref = usage_records->textures_1d.size(); in operator ()()
[all …]
/external/tensorflow/tensorflow/lite/delegates/gpu/metal/
Dinference_context.cc73 std::map<ValueId, int2>* usage_records) { in AddUsage() argument
74 auto it = usage_records->find(id); in AddUsage()
75 if (it == usage_records->end()) { in AddUsage()
77 (*usage_records)[id].x = task_index; in AddUsage()
78 (*usage_records)[id].y = task_index; in AddUsage()
81 (*usage_records)[id].y = task_index; in AddUsage()
553 std::vector<TensorUsageRecord<DummyTensor>> usage_records; in AllocateMemoryForStrongShapes() local
556 remap_from_graph_ids[usage.first] = usage_records.size(); in AllocateMemoryForStrongShapes()
557 usage_records.push_back({tensor_reserver_.Get(usage.first), in AllocateMemoryForStrongShapes()
564 usage_records, MemoryStrategy::EQUALITY, &assignment)); in AllocateMemoryForStrongShapes()
/external/tensorflow/tensorflow/lite/delegates/gpu/cl/
Dinference_context.cc88 std::map<ValueId, int2>* usage_records) { in AddUsage() argument
89 auto it = usage_records->find(id); in AddUsage()
90 if (it == usage_records->end()) { in AddUsage()
91 (*usage_records)[id].x = task_index; in AddUsage()
92 (*usage_records)[id].y = task_index; in AddUsage()
94 (*usage_records)[id].y = task_index; in AddUsage()
583 std::vector<TensorUsageRecord<DummyTensor>> usage_records; in AllocateMemoryForStrongShapes() local
586 remap_from_graph_ids[usage.first] = usage_records.size(); in AllocateMemoryForStrongShapes()
587 usage_records.push_back({tensor_reserver_.Get(usage.first), in AllocateMemoryForStrongShapes()
594 usage_records, MemoryStrategy::EQUALITY, &assignment)); in AllocateMemoryForStrongShapes()