================
@@ -614,6 +614,21 @@ TargetAllocTy convertOlToPluginAllocTy(ol_alloc_type_t
Type) {
}
}
+ol_alloc_type_t convertPluginToOlAllocTy(TargetAllocTy Type) {
+ switch (Type) {
+ case TARGET_ALLOC_DEVICE:
+ return OL_ALLOC_TYPE_DEVICE;
+ case TARGET_ALLOC_HOST:
+ return OL_ALLOC_TYPE_HOST;
+ case TARGET_ALLOC_SHARED:
+ return OL_ALLOC_TYPE_MANAGED;
+ default:
+ // Seems a reasonable default, although this default should never get hit
+ // with allocations made through liboffload
+ return OL_ALLOC_TYPE_MANAGED;
----------------
jhuber6 wrote:
When would we hit this default? I'm wondering if it'd be better as an
unreachable, otherwise I'd expect device allocations to be more common.
https://github.com/llvm/llvm-project/pull/157651
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits