-
Notifications
You must be signed in to change notification settings - Fork 32
Feature/memory zero copy #152
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 24 commits
0714fee
906d77b
dfc0ac8
eaf8574
63b9b07
ec742a0
5df0bf6
e46f6ff
5a2bcf4
242eb3a
cebc064
2f6a01c
9dbe493
ce554ac
f3d1899
f977746
5479b54
b7ab952
e9a9633
51fc1e6
a4b5b1f
fc5a4ed
153631f
8367c6b
a95d2f2
59b078b
7007eb9
34dfadf
5bb48f2
3951ee6
e73c817
7b41388
efe65c4
1b3c7e4
50e8503
3b06ba8
9cd6bd8
1da34fc
8f634ec
ca6dcfb
62dcdd2
692cb41
a7d6356
a7ba748
c5a31f5
948a67b
e654c1f
b7fdc53
a05327d
6d7375e
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 |
|---|---|---|
|
|
@@ -40,6 +40,8 @@ namespace | |
|
|
||
| // Create wrappers for C Binding types (see CBindingWrapping.h). | ||
| DEFINE_SIMPLE_CONVERSION_FUNCTIONS(queue, DPPLSyclQueueRef) | ||
| DEFINE_SIMPLE_CONVERSION_FUNCTIONS(device, DPPLSyclDeviceRef) | ||
| DEFINE_SIMPLE_CONVERSION_FUNCTIONS(context, DPPLSyclContextRef) | ||
|
|
||
| /*! | ||
| * @brief A helper class to support the DPPLSyclQueuemanager. | ||
|
|
@@ -534,3 +536,18 @@ void DPPLQueueMgr_PopQueue () | |
| { | ||
| QMgrHelper::popSyclQueue(); | ||
| } | ||
|
|
||
| /*! | ||
| * The function constructs a new SYCL queue instance from SYCL conext and | ||
| * SYCL device. | ||
| */ | ||
| DPPLSyclQueueRef | ||
| DPPLQueueMgr_GetQueueFromContextAndDevice(__dppl_keep DPPLSyclContextRef CRef, | ||
diptorupd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| __dppl_keep DPPLSyclDeviceRef DRef) | ||
oleksandr-pavlyk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| auto dev = unwrap(DRef); | ||
| auto ctx = unwrap(CRef); | ||
| auto q = queue(*ctx, *dev); | ||
oleksandr-pavlyk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return wrap(new queue(q)); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -244,6 +244,22 @@ TEST_F (TestDPPLSyclQueueManager, CheckIsCurrentQueue2) | |
| DPPLQueueMgr_PopQueue(); | ||
| } | ||
|
|
||
| TEST_F (TestDPPLSyclQueueManager, CreateQueueFromDeviceAndContext) | ||
| { | ||
| auto Q = DPPLQueueMgr_GetCurrentQueue(); | ||
| auto D = DPPLQueue_GetDevice(Q); | ||
|
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. Not important here, but all the |
||
| auto C = DPPLQueue_GetContext(Q); | ||
|
|
||
| auto Q2 = DPPLQueueMgr_GetQueueFromContextAndDevice(C, D); | ||
| auto D2 = DPPLQueue_GetDevice(Q2); | ||
| auto C2 = DPPLQueue_GetContext(Q2); | ||
|
|
||
| EXPECT_TRUE(DPPLDevice_AreEq(D, D2)); | ||
| EXPECT_TRUE(DPPLContext_AreEq(C, C2)); | ||
|
|
||
|
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. Maybe also
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. Queues are going to be pointer-different, but devices and contexts should be the same. |
||
| DPPLQueue_Delete(Q2); | ||
| } | ||
|
|
||
| int | ||
| main (int argc, char** argv) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.