Movatterモバイル変換


[0]ホーム

URL:


Vulkan API Reference Pageslatest

vkGetCudaModuleCacheNV(3)

Name

vkGetCudaModuleCacheNV - Get CUDA module cache

C Specification

To get the CUDA module cache call:

// Provided by VK_NV_cuda_kernel_launchVkResult vkGetCudaModuleCacheNV(    VkDevice                                    device,    VkCudaModuleNV                              module,    size_t*                                     pCacheSize,    void*                                       pCacheData);

Parameters

  • device is the logical device that destroys the Function.

  • module is the CUDA module.

  • pCacheSize is a pointer containing the amount of bytes to becopied inpCacheData

  • pCacheData is a pointer to a buffer in which to copy the binarycache

Description

IfpCacheData isNULL, then the size of the binary cache, in bytes,is returned inpCacheSize.Otherwise,pCacheSizemust point to a variable set by the applicationto the size of the buffer, in bytes, pointed to bypCacheData, and onreturn the variable is overwritten with the amount of data actually writtentopCacheData.IfpCacheSize is less than the size of the binary shader code, nothingis written topCacheData, andVK_INCOMPLETE will be returnedinstead ofVK_SUCCESS.

The returned cachemay then be used later for further initialization of theCUDA module, by sending this cacheinstead of the PTX code when usingvkCreateCudaModuleNV.

Using the binary cache instead of the original PTX codeshouldsignificantly speed up initialization of the CUDA module, given that thewhole compilation and validation will not be necessary.

As withVkPipelineCache, the binary cache depends on the specificimplementation.The applicationmust assume the cache upload might fail in manycircumstances and thusmay have to get ready for falling back to theoriginal PTX code if necessary.Most often, the cachemay succeed if the same device driver andarchitecture is used between the cache generation from PTX and the use ofthis cache.In the event of a new driver version or if using a different devicearchitecture, this cachemay become invalid.

This query does not behave consistently with the behavior described inOpaque Binary Data Results, for historicalreasons.

If the amount of data available is larger than the passedpDataSize,the query returns aVK_INCOMPLETE success status instead of aVK_ERROR_NOT_ENOUGH_SPACE_KHR error status.

Valid Usage (Implicit)
  • VUID-vkGetCudaModuleCacheNV-device-parameter
    devicemust be a validVkDevice handle

  • VUID-vkGetCudaModuleCacheNV-module-parameter
    modulemust be a validVkCudaModuleNV handle

  • VUID-vkGetCudaModuleCacheNV-pCacheSize-parameter
    pCacheSizemust be a valid pointer to asize_t value

  • VUID-vkGetCudaModuleCacheNV-pCacheData-parameter
    If the value referenced bypCacheSize is not0, andpCacheData is notNULL,pCacheDatamust be a valid pointer to an array ofpCacheSize bytes

  • VUID-vkGetCudaModuleCacheNV-module-parent
    modulemust have been created, allocated, or retrieved fromdevice

See Also

Document Notes

For more information, see theVulkan Specification.

This page is extracted from the Vulkan Specification.Fixes and changes should be made to the Specification, not directly.


[8]ページ先頭

©2009-2026 Movatter.jp