Skip to content

Conversation

@deukhyun-cha
Copy link
Contributor

Description

  • Add creating a non-blocking stream based on a stream property value "nonblocking"
  • Current implementation applies to cuda and hip modes only
  • An example is added to demonstrate the usage

- Add creating a non-blocking stream based on a stream property value "nonblocking"
- Current implementation applies to cuda and hip modes only
- An example is added to demonstrate the usage

Related work items: #601
@noelchalmers
Copy link
Contributor

I'm not sure I see the value-add of this.

  • This option only affects how streams would or would not overlap with work on the NULL stream. But the NULL stream isn't used for any kernels/async APIs in OCCA. Hence this behavior would only be usable in a user's code that is interop-ing OCCA with CUDA or HIP (modulo some blocking memcpys which are always avoidable).
  • Consequently, a more valuable and flexible contribution would probably be a device::wrapStream method, rather than additional options at stream creation.
  • That new method would be able to support OpenCL's commandQueue options as well.

Just my $0.02 CND.

@tcew
Copy link
Collaborator

tcew commented Jun 18, 2021

Is that like $0.01 US?

@amikstcyr
Copy link
Contributor

amikstcyr commented Jun 19, 2021

Thank you for the feedback!

In our opinion, this PR seems:

  1. to have roughly zero overhead cost,
  2. to have no effect if the underlying API/lib is not syncing with some sort of base stream,
  3. to be useful when interfacing with certain libraries,
  4. to be ready & responds to a need/use case hence immediately useful.

We could work on your suggestion but not sure why doing so would block this particular PR.

Tim: it's more like 0.015 USD... :-)

@codecov
Copy link

codecov bot commented Sep 18, 2021

Codecov Report

Merging #498 (cea4cba) into main (5db15e0) will increase coverage by 0.05%.
The diff coverage is n/a.

❗ Current head cea4cba differs from pull request most recent head 558be5e. Consider uploading reports for the commit 558be5e to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
+ Coverage   76.41%   76.46%   +0.05%     
==========================================
  Files         261      257       -4     
  Lines       19500    19352     -148     
==========================================
- Hits        14900    14797     -103     
+ Misses       4600     4555      -45     
Impacted Files Coverage Δ
src/c/kernel_fortran_interface.cpp 0.00% <0.00%> (-10.00%) ⬇️
src/occa/internal/utils/store.hpp 90.62% <0.00%> (-6.25%) ⬇️
src/occa/internal/utils/sys.cpp 72.89% <0.00%> (-3.62%) ⬇️
src/dtype/builtins.cpp 44.44% <0.00%> (-2.78%) ⬇️
src/c/base.cpp 84.88% <0.00%> (-2.33%) ⬇️
src/occa/internal/modes/serial/registration.cpp 91.11% <0.00%> (-2.23%) ⬇️
src/occa/internal/utils/env.cpp 81.25% <0.00%> (-1.25%) ⬇️
...a/internal/lang/statement/declarationStatement.cpp 91.91% <0.00%> (-1.09%) ⬇️
src/occa/internal/utils/string.cpp 84.44% <0.00%> (-0.89%) ⬇️
src/occa/internal/lang/specialMacros.cpp 60.26% <0.00%> (-0.67%) ⬇️
... and 9 more

@kris-rowe kris-rowe linked an issue Dec 6, 2021 that may be closed by this pull request
@kris-rowe kris-rowe merged commit 5f5ec0f into libocca:main Dec 6, 2021
@deukhyun-cha deukhyun-cha deleted the stream-nonblock branch January 12, 2022 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for non-blocking streams

5 participants