Skip to content

Commit f1c5fc6

Browse files
SS-JIAfacebook-github-bot
authored andcommitted
Use MemoryAccessFlags instead of MemoryAccessType when binding (pytorch#5591)
Summary: Pull Request resolved: pytorch#5591 ## Context Correct `ComputeGraph` functions to accept `MemoryAccessFlags` instead of `MemoryAccessType`. `MemoryAccessType` correspond to only a single bit, i.e. `READ` or `WRITE` but `MemoryAccessFlags` allows us to express a combination of bits which is the intended behaviour. ghstack-source-id: 244431148 exported-using-ghexport Reviewed By: jorgep31415 Differential Revision: D63327080 fbshipit-source-id: a4ca6b9f6dfb9a998932b934a2a230fbb3d7c06a
1 parent 2060434 commit f1c5fc6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

backends/vulkan/runtime/graph/ops/ExecuteNode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ class ComputeGraph;
2121
* access permission.
2222
*/
2323
struct ArgGroup {
24-
ArgGroup(const ValueRef ref, const vkapi::MemoryAccessType access)
24+
ArgGroup(const ValueRef ref, const vkapi::MemoryAccessFlags access)
2525
: refs{ref}, access(access) {}
2626

2727
ArgGroup(
2828
const std::vector<ValueRef>& refs,
29-
const vkapi::MemoryAccessType access)
29+
const vkapi::MemoryAccessFlags access)
3030
: refs(refs), access(access) {}
3131

3232
const std::vector<ValueRef> refs;
33-
const vkapi::MemoryAccessType access;
33+
const vkapi::MemoryAccessFlags access;
3434
};
3535

3636
/*

backends/vulkan/runtime/graph/ops/utils/BindingUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace vkcompute {
1313
void bind_tensor_to_descriptor_set(
1414
api::vTensor& tensor,
1515
vkapi::PipelineBarrier& pipeline_barrier,
16-
const vkapi::MemoryAccessType accessType,
16+
const vkapi::MemoryAccessFlags accessType,
1717
vkapi::DescriptorSet& descriptor_set,
1818
const uint32_t idx) {
1919
if (tensor.buffer()) {

backends/vulkan/runtime/graph/ops/utils/BindingUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace vkcompute {
1919
void bind_tensor_to_descriptor_set(
2020
api::vTensor& tensor,
2121
vkapi::PipelineBarrier& pipeline_barrier,
22-
const vkapi::MemoryAccessType accessType,
22+
const vkapi::MemoryAccessFlags accessType,
2323
vkapi::DescriptorSet& descriptor_set,
2424
const uint32_t idx);
2525

0 commit comments

Comments
 (0)