Conversation
| } | ||
|
|
||
| #define ASSERT_NV_SUCCESS(expr, log) { auto re = check_nv_err((expr), cudaHandler, m_logger, __FILE__, __LINE__, log); assert(re); } | ||
|
|
Member
There was a problem hiding this comment.
might want to make an nbl/examples/cuda for this
Comment on lines
+52
to
+83
| smart_refctd_ptr<CCUDAHandler> cudaHandler; | ||
| smart_refctd_ptr<CCUDADevice> cudaDevice; | ||
|
|
||
| IQueue* queue; | ||
|
|
||
|
|
||
| // a device filter helps you create a set of physical devices that satisfy your requirements in terms of features, limits etc. | ||
| virtual void filterDevices(core::set<video::IPhysicalDevice*>& physicalDevices) const | ||
| { | ||
| device_base_t::filterDevices(physicalDevices); | ||
| auto& cuDevices = cudaHandler->getAvailableDevices(); | ||
| std::erase_if(physicalDevices, [&cuDevices](auto pdev) { | ||
| return cuDevices.end() == std::find_if(cuDevices.begin(), cuDevices.end(), [pdev](auto& cuDev) { return !memcmp(pdev->getProperties().deviceUUID, &cuDev.uuid, 16); }); | ||
| }); | ||
| } | ||
|
|
||
| bool onAppInitialized(smart_refctd_ptr<ISystem>&& system) override | ||
| { | ||
| // Remember to call the base class initialization! | ||
| if (!asset_base_t::onAppInitialized(smart_refctd_ptr(system))) | ||
| return false; | ||
|
|
||
| cudaHandler = CCUDAHandler::create(m_system.get(), smart_refctd_ptr<ILogger>(m_logger)); | ||
| if (!cudaHandler) | ||
| return logFail("Could not create a CUDA handler!"); | ||
|
|
||
| if (!device_base_t::onAppInitialized(std::move(system))) | ||
| return false; | ||
|
|
||
| cudaDevice = cudaHandler->createDevice(smart_refctd_ptr_dynamic_cast<CVulkanConnection>(m_api), m_physicalDevice); | ||
| if (!cudaDevice) | ||
| return logFail("Could not create a CUDA Device!"); |
There was a problem hiding this comment.
add to application_templates ? MonoCUDADeviceApplciation?
There was a problem hiding this comment.
basically whatever you need for your CUDA GEMM 1 and 4 bit example, commonalize into the application_templates and examples/cuda
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.
Vk Cuda Interop Sample test