OpenCL: are device-side out-of-order queues also parallel?
I'm doing some tests using device-side out-of-order command queues in combination with calls to enqueue_kernel to give them work.
My question is regarding the nature of the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE flag set on the device-side queue when it is initialized.
As per the spec:
"If the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE property of a
commandqueue is set, then there is no guarantee that kernel A will
finish before kernel B starts execution. "
However, that wording leaves two (ambiguous) possibilities:
kernel A starts, kernel B starts, kernel B finishes, kernel A finishes (they are launched in sequence, but run parallel, allowing for out-of-order completion/execution)
kernel B starts, kernel B finishes, kernel A starts, kernel A finishes (they run in sequence, but are launched out of order)
Possibility 2 is what I'd expect, but Possibility 1 fits the description...so which assumption is correct? Or are they both possible? Is the behavior vendor/implementation specific?
queue opencl
add a comment |
I'm doing some tests using device-side out-of-order command queues in combination with calls to enqueue_kernel to give them work.
My question is regarding the nature of the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE flag set on the device-side queue when it is initialized.
As per the spec:
"If the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE property of a
commandqueue is set, then there is no guarantee that kernel A will
finish before kernel B starts execution. "
However, that wording leaves two (ambiguous) possibilities:
kernel A starts, kernel B starts, kernel B finishes, kernel A finishes (they are launched in sequence, but run parallel, allowing for out-of-order completion/execution)
kernel B starts, kernel B finishes, kernel A starts, kernel A finishes (they run in sequence, but are launched out of order)
Possibility 2 is what I'd expect, but Possibility 1 fits the description...so which assumption is correct? Or are they both possible? Is the behavior vendor/implementation specific?
queue opencl
1
I believe they're both possible and as you say certainly within spec. There's not really a good way to find out which is happening without vendor specific tooling.
– pmdj
Jan 3 at 10:59
add a comment |
I'm doing some tests using device-side out-of-order command queues in combination with calls to enqueue_kernel to give them work.
My question is regarding the nature of the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE flag set on the device-side queue when it is initialized.
As per the spec:
"If the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE property of a
commandqueue is set, then there is no guarantee that kernel A will
finish before kernel B starts execution. "
However, that wording leaves two (ambiguous) possibilities:
kernel A starts, kernel B starts, kernel B finishes, kernel A finishes (they are launched in sequence, but run parallel, allowing for out-of-order completion/execution)
kernel B starts, kernel B finishes, kernel A starts, kernel A finishes (they run in sequence, but are launched out of order)
Possibility 2 is what I'd expect, but Possibility 1 fits the description...so which assumption is correct? Or are they both possible? Is the behavior vendor/implementation specific?
queue opencl
I'm doing some tests using device-side out-of-order command queues in combination with calls to enqueue_kernel to give them work.
My question is regarding the nature of the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE flag set on the device-side queue when it is initialized.
As per the spec:
"If the CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE property of a
commandqueue is set, then there is no guarantee that kernel A will
finish before kernel B starts execution. "
However, that wording leaves two (ambiguous) possibilities:
kernel A starts, kernel B starts, kernel B finishes, kernel A finishes (they are launched in sequence, but run parallel, allowing for out-of-order completion/execution)
kernel B starts, kernel B finishes, kernel A starts, kernel A finishes (they run in sequence, but are launched out of order)
Possibility 2 is what I'd expect, but Possibility 1 fits the description...so which assumption is correct? Or are they both possible? Is the behavior vendor/implementation specific?
queue opencl
queue opencl
edited Jan 11 at 16:37
Machavity
24.7k135981
24.7k135981
asked Jan 2 at 21:13
TysonTyson
4871315
4871315
1
I believe they're both possible and as you say certainly within spec. There's not really a good way to find out which is happening without vendor specific tooling.
– pmdj
Jan 3 at 10:59
add a comment |
1
I believe they're both possible and as you say certainly within spec. There's not really a good way to find out which is happening without vendor specific tooling.
– pmdj
Jan 3 at 10:59
1
1
I believe they're both possible and as you say certainly within spec. There's not really a good way to find out which is happening without vendor specific tooling.
– pmdj
Jan 3 at 10:59
I believe they're both possible and as you say certainly within spec. There's not really a good way to find out which is happening without vendor specific tooling.
– pmdj
Jan 3 at 10:59
add a comment |
1 Answer
1
active
oldest
votes
First option. The kernels are still "dispatched" in order. And if kernel A fills the machine with threads and leaves no room for kernel B, there'll be no difference. But if A doesn't fill the machine, and out_of_order is enabled, then kernel B will be dispatched right after A has finished dispatching its threads (i.e. its threads can still be executing). And the kernels can continue running in parallel.
Now it's possible the spec might have left it ambiguous as to the order of first dispatch, but since the dispatch of kernels is sequentially coming out of the CPU, I don't see any rational for why or how a vendor would allow possibility 2.
add a comment |
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54013266%2fopencl-are-device-side-out-of-order-queues-also-parallel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
First option. The kernels are still "dispatched" in order. And if kernel A fills the machine with threads and leaves no room for kernel B, there'll be no difference. But if A doesn't fill the machine, and out_of_order is enabled, then kernel B will be dispatched right after A has finished dispatching its threads (i.e. its threads can still be executing). And the kernels can continue running in parallel.
Now it's possible the spec might have left it ambiguous as to the order of first dispatch, but since the dispatch of kernels is sequentially coming out of the CPU, I don't see any rational for why or how a vendor would allow possibility 2.
add a comment |
First option. The kernels are still "dispatched" in order. And if kernel A fills the machine with threads and leaves no room for kernel B, there'll be no difference. But if A doesn't fill the machine, and out_of_order is enabled, then kernel B will be dispatched right after A has finished dispatching its threads (i.e. its threads can still be executing). And the kernels can continue running in parallel.
Now it's possible the spec might have left it ambiguous as to the order of first dispatch, but since the dispatch of kernels is sequentially coming out of the CPU, I don't see any rational for why or how a vendor would allow possibility 2.
add a comment |
First option. The kernels are still "dispatched" in order. And if kernel A fills the machine with threads and leaves no room for kernel B, there'll be no difference. But if A doesn't fill the machine, and out_of_order is enabled, then kernel B will be dispatched right after A has finished dispatching its threads (i.e. its threads can still be executing). And the kernels can continue running in parallel.
Now it's possible the spec might have left it ambiguous as to the order of first dispatch, but since the dispatch of kernels is sequentially coming out of the CPU, I don't see any rational for why or how a vendor would allow possibility 2.
First option. The kernels are still "dispatched" in order. And if kernel A fills the machine with threads and leaves no room for kernel B, there'll be no difference. But if A doesn't fill the machine, and out_of_order is enabled, then kernel B will be dispatched right after A has finished dispatching its threads (i.e. its threads can still be executing). And the kernels can continue running in parallel.
Now it's possible the spec might have left it ambiguous as to the order of first dispatch, but since the dispatch of kernels is sequentially coming out of the CPU, I don't see any rational for why or how a vendor would allow possibility 2.
answered Jan 31 at 5:38
HashmanHashman
1797
1797
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54013266%2fopencl-are-device-side-out-of-order-queues-also-parallel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I believe they're both possible and as you say certainly within spec. There's not really a good way to find out which is happening without vendor specific tooling.
– pmdj
Jan 3 at 10:59