-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Hexagon] Add concept of DMA groups #14254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f9e08b8
7d3379e
63900f5
5b82dce
4b70ece
fecf53a
131c010
37e24c8
9b268d0
b13d36d
8e357f5
d459026
aba5453
04c238e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,10 +210,10 @@ TVM_REGISTER_GLOBAL("device_api.hexagon.dma_copy_dltensor") | |
| }); | ||
|
|
||
| TVM_REGISTER_GLOBAL("device_api.hexagon.dma_copy").set_body([](TVMArgs args, TVMRetValue* rv) { | ||
| int queue_id = args[0]; | ||
| uint32_t queue_id = static_cast<int>(args[0]); | ||
| void* dst = args[1]; | ||
| void* src = args[2]; | ||
| int size = args[3]; | ||
| uint32_t size = static_cast<int>(args[3]); | ||
| ICHECK(size > 0); | ||
| bool bypass_cache = args[4]; | ||
|
|
||
|
|
@@ -226,13 +226,26 @@ TVM_REGISTER_GLOBAL("device_api.hexagon.dma_copy").set_body([](TVMArgs args, TVM | |
| }); | ||
|
|
||
| TVM_REGISTER_GLOBAL("device_api.hexagon.dma_wait").set_body([](TVMArgs args, TVMRetValue* rv) { | ||
| int queue_id = args[0]; | ||
| uint32_t queue_id = static_cast<int>(args[0]); | ||
| int inflight = args[1]; | ||
| ICHECK(inflight >= 0); | ||
| HexagonDeviceAPI::Global()->UserDMA()->Wait(queue_id, inflight); | ||
| *rv = static_cast<int32_t>(0); | ||
| }); | ||
|
|
||
| TVM_REGISTER_GLOBAL("device_api.hexagon.dma_start_group") | ||
| .set_body([](TVMArgs args, TVMRetValue* rv) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: When the input/output types are fixed, the .set_body_typed([](int queue_id) -> int32_t {
return HexagonDeviceAPI::Global()->UserDMA()->StartGroup(queue_id);
});
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chose not to implement this for this iteration as it seems like we could / should redo the entire Hexagon Device API with this change. |
||
| uint32_t queue_id = static_cast<int>(args[0]); | ||
| HexagonDeviceAPI::Global()->UserDMA()->StartGroup(queue_id); | ||
| *rv = static_cast<int32_t>(0); | ||
adstraw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| TVM_REGISTER_GLOBAL("device_api.hexagon.dma_end_group").set_body([](TVMArgs args, TVMRetValue* rv) { | ||
| uint32_t queue_id = static_cast<int>(args[0]); | ||
| HexagonDeviceAPI::Global()->UserDMA()->EndGroup(queue_id); | ||
| *rv = static_cast<int32_t>(0); | ||
| }); | ||
|
|
||
| TVM_REGISTER_GLOBAL("device_api.hexagon.alloc_nd").set_body([](TVMArgs args, TVMRetValue* rv) { | ||
| int32_t device_type = args[0]; | ||
| int32_t device_id = args[1]; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.