Vk cuda interop#1061
Open
kevyuu wants to merge 180 commits into
Open
Conversation
added 30 commits
March 23, 2026 17:37
Comment on lines
+58
to
+77
| core::smart_refctd_ptr<ISemaphore> CVulkanLogicalDevice::createSemaphore(const uint64_t initialValue) | ||
| { | ||
|
|
||
| VkSemaphoreTypeCreateInfoKHR type = { VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR }; | ||
| type.pNext = nullptr; // Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExportSemaphoreCreateInfo, VkExportSemaphoreWin32HandleInfoKHR, or VkSemaphoreTypeCreateInfo | ||
| type.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE_KHR; | ||
| type.initialValue = initialValue; | ||
|
|
||
| VkSemaphoreCreateInfo createInfo = { VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,&type }; | ||
| createInfo.flags = static_cast<VkSemaphoreCreateFlags>(0); // flags must be 0 | ||
|
|
||
| core::smart_refctd_ptr<ISemaphore> CVulkanLogicalDevice::createSemaphore(const uint64_t initialValue, ISemaphore::SCreationParams&& creationParams) | ||
| VkSemaphore semaphore; | ||
| if (!m_devf.vk.vkCreateSemaphore(m_vkdev, &createInfo, nullptr, &semaphore) == VK_SUCCESS) | ||
| return nullptr; | ||
|
|
||
| ISemaphore::SCreationParams creationParams; | ||
| creationParams.initialValue = initialValue; | ||
| return core::make_smart_refctd_ptr<CVulkanSemaphore>(core::smart_refctd_ptr<CVulkanLogicalDevice>(this), std::move(creationParams), semaphore, system::ExternalHandleNull); | ||
| } | ||
|
|
There was a problem hiding this comment.
this is unclean duplicate code, it should be a 1-liner to the other function
| , m_src(std::move(src)) | ||
| , m_native(std::move(nativeState)) | ||
| { | ||
| assert(m_native); |
There was a problem hiding this comment.
can actually assert false in every function because the object is never meant to be made, ever
…rogramming/Nabla into vk_cuda_interop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bridging CUDA and Vulkan
Testing
Test Pull Request