Skip to content

Use increasing semaphore signal values in Vulkan sample. - #3116

Merged
ScottTodd merged 1 commit into
iree-org:mainfrom
ScottTodd:vk-sample-signalvalue
Sep 10, 2020
Merged

ScottTodd merged 1 commit into
iree-org:mainfrom
ScottTodd:vk-sample-signalvalue

Conversation

@ScottTodd

Copy link
Copy Markdown
Member

Follow-up to #3089 . Tested with timeline semaphore emulation forced enabled, on Windows with native Vulkan support (NVIDIA).

@ScottTodd ScottTodd added the hal/vulkan Runtime Vulkan GPU HAL backend label Sep 10, 2020
@google-cla google-cla Bot added the cla: yes label Sep 10, 2020

@benvanik benvanik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also want to set the wait value to frame_number - 1? (accounting for frame 0)

@ScottTodd

Copy link
Copy Markdown
Member Author

I think you also want to set the wait value to frame_number - 1? (accounting for frame 0)

That would be possible. I have it set up now to always wait on a separate semaphore reaching 0 (which it starts at) and issue a blocking wait right after issuing the command. For a larger computation and real pipelined behavior we can change it to roughly

int invoke_number = 0
while (running) {
  if (complete) {
    // use results
    wait_value = invoke_number
    signal_value = ++invoke_number
    invoke(wait, args, signal)
  }
  // other loop code
}

(there are of course other ways to sequence this, and it would be useful to demo a few different usage models)

@benvanik

Copy link
Copy Markdown
Collaborator

Oh. I guess I don't see a point of doing this if you aren't chaining semaphores - may as well wait until you are actually using semaphores in a way that is useful :)

@benvanik
benvanik self-requested a review September 10, 2020 20:58
@ScottTodd

Copy link
Copy Markdown
Member Author

Oh. I guess I don't see a point of doing this if you aren't chaining semaphores - may as well wait until you are actually using semaphores in a way that is useful :)

:P That's fair. At first I just wanted to test that the $async functions I generated were actually functional. There's definitely more interesting behavior this sample could be showing.

@ScottTodd
ScottTodd merged commit 36ffc29 into iree-org:main Sep 10, 2020
@ScottTodd
ScottTodd deleted the vk-sample-signalvalue branch September 10, 2020 21:45
@hanhanW hanhanW mentioned this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hal/vulkan Runtime Vulkan GPU HAL backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants