MUSA Runtime API Reference
Supported APIs
The following table lists the Runtime APIs supported in MUSA SDK 5.1.0.
| API | Header |
|---|---|
__musaPushCallConfiguration | device_functions.h |
__musaPopCallConfiguration | host_runtime.h |
__musaRegisterFatBinary | host_runtime.h |
__musaRegisterFatBinaryEnd | host_runtime.h |
__musaRegisterFunction | host_runtime.h |
__musaRegisterVar | host_runtime.h |
__musaRegisterTexture | host_runtime.h |
__musaRegisterSurface | host_runtime.h |
__musaUnregisterFatBinary | host_runtime.h |
musaThreadExit | musa_runtime_api.h |
musaThreadSynchronize | musa_runtime_api.h |
musaThreadSetLimit | musa_runtime_api.h |
musaThreadGetLimit | musa_runtime_api.h |
musaThreadGetCacheConfig | musa_runtime_api.h |
musaThreadSetCacheConfig | musa_runtime_api.h |
musaBindTexture | musa_runtime_api.h |
musaUnbindTexture | musa_runtime_api.h |
musaBindTexture2D | musa_runtime_api.h |
musaBindTextureToArray | musa_runtime_api.h |
musaGetTextureAlignmentOffset | musa_runtime_api.h |
musaBindTextureToMipmappedArray | musa_runtime_api.h |
musaGetTextureReference | musa_runtime_api.h |
musaBindSurfaceToArray | musa_runtime_api.h |
musaGetSurfaceReference | musa_runtime_api.h |
musaMemcpyFromArray | musa_runtime_api.h |
musaMemcpyFromArrayAsync | musa_runtime_api.h |
musaMemcpyToArray | musa_runtime_api.h |
musaMemcpyToArrayAsync | musa_runtime_api.h |
musaDeviceGetPCIBusId | musa_runtime_api.h |
musaDeviceGetByPCIBusId | musa_runtime_api.h |
musaDeviceGetLimit | musa_runtime_api.h |
musaDeviceSetLimit | musa_runtime_api.h |
musaDeviceGetP2PAttribute | musa_runtime_api.h |
musaDeviceGetSharedMemConfig | musa_runtime_api.h |
musaDeviceSetSharedMemConfig | musa_runtime_api.h |
musaDeviceGetStreamPriorityRange | musa_runtime_api.h |
musaDeviceReset | musa_runtime_api.h |
musaDeviceSynchronize | musa_runtime_api.h |
musaGetDevice | musa_runtime_api.h |
musaGetDeviceCount | musa_runtime_api.h |
musaSetDevice | musa_runtime_api.h |
musaGetDeviceFlags | musa_runtime_api.h |
musaSetDeviceFlags | musa_runtime_api.h |
musaGetDeviceProperties_v2 | musa_runtime_api.h |
musaGetDeviceProperties | musa_runtime_api.h |
musaInitDevice | musa_runtime_api.h |
musaDeviceGetTexture1DLinearMaxWidth | musa_runtime_api.h |
musaDeviceGetCacheConfig | musa_runtime_api.h |
musaDeviceSetCacheConfig | musa_runtime_api.h |
musaChooseDevice | musa_runtime_api.h |
musaDeviceGetAttribute | musa_runtime_api.h |
musaGetExportTable | musa_runtime_api.h |
musaGetDriverEntryPoint | musa_runtime_api.h |
musaGetDriverEntryPointByVersion | musa_runtime_api.h |
musaGetLastError | musa_runtime_api.h |
musaGetErrorName | musa_runtime_api.h |
musaGetErrorString | musa_runtime_api.h |
musaPeekAtLastError | musa_runtime_api.h |
musaEventCreate | musa_runtime_api.h |
musaEventCreateWithFlags | musa_runtime_api.h |
musaEventDestroy | musa_runtime_api.h |
musaEventQuery | musa_runtime_api.h |
musaEventRecord | musa_runtime_api.h |
musaEventRecordWithFlags | musa_runtime_api.h |
musaEventSynchronize | musa_runtime_api.h |
musaEventElapsedTime | musa_runtime_api.h |
musaEventElapsedTime_v2 | musa_runtime_api.h |
musaIpcGetEventHandle | musa_runtime_api.h |
musaIpcOpenEventHandle | musa_runtime_api.h |
musaGraphicsMapResources | musa_runtime_api.h |
musaGraphicsResourceGetMappedPointer | musa_runtime_api.h |
musaGraphicsResourceSetMapFlags | musa_runtime_api.h |
musaGraphicsUnmapResources | musa_runtime_api.h |
musaGraphicsUnregisterResource | musa_runtime_api.h |
musaGraphAddHostNode | musa_runtime_api.h |
musaGraphAddKernelNode | musa_runtime_api.h |
musaGraphAddMemcpyNode1D | musa_runtime_api.h |
musaGraphAddMemcpyNode | musa_runtime_api.h |
musaGraphAddMemcpyNodeFromSymbol | musa_runtime_api.h |
musaGraphAddMemcpyNodeToSymbol | musa_runtime_api.h |
musaGraphAddMemsetNode | musa_runtime_api.h |
musaGraphAddChildGraphNode | musa_runtime_api.h |
musaGraphAddDependencies | musa_runtime_api.h |
musaGraphRemoveDependencies | musa_runtime_api.h |
musaGraphAddEmptyNode | musa_runtime_api.h |
musaGraphAddEventRecordNode | musa_runtime_api.h |
musaGraphAddEventWaitNode | musa_runtime_api.h |
musaGraphAddMemAllocNode | musa_runtime_api.h |
musaGraphAddMemFreeNode | musa_runtime_api.h |
musaGraphClone | musa_runtime_api.h |
musaGraphCreate | musa_runtime_api.h |
musaGraphDestroy | musa_runtime_api.h |
musaGraphDestroyNode | musa_runtime_api.h |
musaGraphEventRecordNodeGetEvent | musa_runtime_api.h |
musaGraphEventRecordNodeSetEvent | musa_runtime_api.h |
musaGraphEventWaitNodeGetEvent | musa_runtime_api.h |
musaGraphEventWaitNodeSetEvent | musa_runtime_api.h |
musaGraphExecDestroy | musa_runtime_api.h |
musaGraphGetNodes | musa_runtime_api.h |
musaGraphGetRootNodes | musa_runtime_api.h |
musaGraphNodeGetDependencies | musa_runtime_api.h |
musaGraphGetEdges | musa_runtime_api.h |
musaGraphNodeGetDependentNodes | musa_runtime_api.h |
musaGraphHostNodeGetParams | musa_runtime_api.h |
musaGraphHostNodeSetParams | musa_runtime_api.h |
musaGraphInstantiate | musa_runtime_api.h |
musaGraphInstantiateWithFlags | musa_runtime_api.h |
musaGraphExecGetFlags | musa_runtime_api.h |
musaGraphKernelNodeGetParams | musa_runtime_api.h |
musaGraphKernelNodeSetParams | musa_runtime_api.h |
musaGraphKernelNodeSetAttribute | musa_runtime_api.h |
musaGraphKernelNodeGetAttribute | musa_runtime_api.h |
musaGraphKernelNodeCopyAttributes | musa_runtime_api.h |
musaGraphLaunch | musa_runtime_api.h |
musaGraphUpload | musa_runtime_api.h |
musaGraphMemcpyNodeGetParams | musa_runtime_api.h |
musaGraphMemcpyNodeSetParams | musa_runtime_api.h |
musaGraphMemcpyNodeSetParams1D | musa_runtime_api.h |
musaGraphMemsetNodeGetParams | musa_runtime_api.h |
musaGraphMemsetNodeSetParams | musa_runtime_api.h |
musaGraphNodeFindInClone | musa_runtime_api.h |
musaGraphNodeGetType | musa_runtime_api.h |
musaGraphExecUpdate | musa_runtime_api.h |
musaGraphExecKernelNodeSetParams | musa_runtime_api.h |
musaGraphExecMemcpyNodeSetParams | musa_runtime_api.h |
musaGraphExecMemcpyNodeSetParams1D | musa_runtime_api.h |
musaGraphExecMemsetNodeSetParams | musa_runtime_api.h |
musaGraphExecHostNodeSetParams | musa_runtime_api.h |
musaGraphNodeSetEnabled | musa_runtime_api.h |
musaGraphNodeGetEnabled | musa_runtime_api.h |
musaGraphAddMemAtomicNode | musa_runtime_api.h |
musaGraphAddMemAtomicValueNode | musa_runtime_api.h |
musaGraphAddMemWaitWriteNode | musa_runtime_api.h |
musaGraphAddMemTransferNode | musa_runtime_api.h |
musaGraphMemAtomicNodeGetParams | musa_runtime_api.h |
musaGraphMemAtomicNodeSetParams | musa_runtime_api.h |
musaGraphMemAtomicValueNodeGetParams | musa_runtime_api.h |
musaGraphMemAtomicValueNodeSetParams | musa_runtime_api.h |
musaGraphMemWaitWriteNodeGetParams | musa_runtime_api.h |
musaGraphMemWaitWriteNodeSetParams | musa_runtime_api.h |
musaGraphMemTransferNodeGetParams | musa_runtime_api.h |
musaGraphMemTransferNodeSetParams | musa_runtime_api.h |
musaGraphExecMemAtomicNodeSetParams | musa_runtime_api.h |
musaGraphExecMemAtomicValueNodeSetParams | musa_runtime_api.h |
musaGraphExecMemWaitWriteNodeSetParams | musa_runtime_api.h |
musaGraphExecMemTransferNodeSetParams | musa_runtime_api.h |
musaGraphNodeSetParams | musa_runtime_api.h |
musaGraphAddNode | musa_runtime_api.h |
musaGraphExecNodeSetParams | musa_runtime_api.h |
musaGraphConditionalHandleCreate | musa_runtime_api.h |
musaUserObjectCreate | musa_runtime_api.h |
musaUserObjectRetain | musa_runtime_api.h |
musaUserObjectRelease | musa_runtime_api.h |
musaGraphRetainUserObject | musa_runtime_api.h |
musaGraphReleaseUserObject | musa_runtime_api.h |
musaGraphDebugDotPrint | musa_runtime_api.h |
musaMalloc | musa_runtime_api.h |
musaMallocPitch | musa_runtime_api.h |
musaMalloc3D | musa_runtime_api.h |
musaMallocHost | musa_runtime_api.h |
musaMallocManaged | musa_runtime_api.h |
musaFree | musa_runtime_api.h |
musaFreeArray | musa_runtime_api.h |
musaFreeHost | musa_runtime_api.h |
musaHostAlloc | musa_runtime_api.h |
musaHostGetDevicePointer | musa_runtime_api.h |
musaHostGetFlags | musa_runtime_api.h |
musaPointerGetAttributes | musa_runtime_api.h |
musaMemcpy | musa_runtime_api.h |
musaMemcpyAsync | musa_runtime_api.h |
musaMemcpyBatchAsync | musa_runtime_api.h |
musaMemcpy3DBatchAsync | musa_runtime_api.h |
musaMemcpy2D | musa_runtime_api.h |
musaMemcpy2DAsync | musa_runtime_api.h |
musaMemcpy2DFromArray | musa_runtime_api.h |
musaMemcpy2DFromArrayAsync | musa_runtime_api.h |
musaMemcpy2DToArray | musa_runtime_api.h |
musaMemcpy2DToArrayAsync | musa_runtime_api.h |
musaMemcpy2DArrayToArray | musa_runtime_api.h |
musaMemcpy3D | musa_runtime_api.h |
musaMemcpy3DPeer | musa_runtime_api.h |
musaMemcpy3DAsync | musa_runtime_api.h |
musaMemcpy3DPeerAsync | musa_runtime_api.h |
musaHostRegister | musa_runtime_api.h |
musaHostUnregister | musa_runtime_api.h |
musaMemGetInfo | musa_runtime_api.h |
musaArrayGetInfo | musa_runtime_api.h |
musaMemset | musa_runtime_api.h |
musaMemsetAsync | musa_runtime_api.h |
musaMemset2D | musa_runtime_api.h |
musaMemset2DAsync | musa_runtime_api.h |
musaMemset3D | musa_runtime_api.h |
musaMemset3DAsync | musa_runtime_api.h |
musaIpcCloseMemHandle | musa_runtime_api.h |
musaIpcGetMemHandle | musa_runtime_api.h |
musaIpcOpenMemHandle | musa_runtime_api.h |
musaMallocMipmappedArray | musa_runtime_api.h |
musaFreeMipmappedArray | musa_runtime_api.h |
musaGetMipmappedArrayLevel | musa_runtime_api.h |
musaMalloc3DArray | musa_runtime_api.h |
musaMallocArray | musa_runtime_api.h |
musaMemAdvise | musa_runtime_api.h |
musaMemAdvise_v2 | musa_runtime_api.h |
musaMemPrefetchAsync | musa_runtime_api.h |
musaMemPrefetchAsync_v2 | musa_runtime_api.h |
musaMemRangeGetAttribute | musa_runtime_api.h |
musaMemRangeGetAttributes | musa_runtime_api.h |
musaMemcpyFromSymbol | musa_runtime_api.h |
musaMemcpyFromSymbolAsync | musa_runtime_api.h |
musaMemcpyToSymbol | musa_runtime_api.h |
musaMemcpyToSymbolAsync | musa_runtime_api.h |
musaMemcpyPeer | musa_runtime_api.h |
musaMemcpyPeerAsync | musa_runtime_api.h |
musaMallocFromPoolAsync | musa_runtime_api.h |
musaMemoryAtomicAsync | musa_runtime_api.h |
musaMemoryAtomicValueAsync | musa_runtime_api.h |
musaMemoryTransfer | musa_runtime_api.h |
musaMemoryTransferAsync | musa_runtime_api.h |
musaLaunchHostFunc | musa_runtime_api.h |
musaLaunchKernel | musa_runtime_api.h |
musaLaunchKernelExC | musa_runtime_api.h |
musaLaunchCooperativeKernel | musa_runtime_api.h |
musaLaunchCooperativeKernelMultiDevice | musa_runtime_api.h |
musaGetSymbolAddress | musa_runtime_api.h |
musaGetSymbolSize | musa_runtime_api.h |
musaFuncGetAttributes | musa_runtime_api.h |
musaFuncGetName | musa_runtime_api.h |
musaFuncGetParamInfo | musa_runtime_api.h |
musaFuncSetAttribute | musa_runtime_api.h |
musaFuncSetCacheConfig | musa_runtime_api.h |
musaFuncSetSharedMemConfig | musa_runtime_api.h |
musaGetFuncBySymbol | musa_runtime_api.h |
musaDeviceRegisterAsyncNotification | musa_runtime_api.h |
musaDeviceUnregisterAsyncNotification | musa_runtime_api.h |
musaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags | musa_runtime_api.h |
musaGraphicsGLRegisterBuffer | musa_gl_interop.h |
musaGLSetGLDevice | musa_gl_interop.h |
musaDeviceCanAccessPeer | musa_runtime_api.h |
musaDeviceEnablePeerAccess | musa_runtime_api.h |
musaDeviceDisablePeerAccess | musa_runtime_api.h |
musaProfilerStart | musa_profiler_api.h |
musaProfilerStop | musa_profiler_api.h |
musaMemPoolCreate | musa_runtime_api.h |
musaMemPoolDestroy | musa_runtime_api.h |
musaMallocAsync | musa_runtime_api.h |
musaFreeAsync | musa_runtime_api.h |
musaMemPoolGetAttribute | musa_runtime_api.h |
musaMemPoolSetAttribute | musa_runtime_api.h |
musaMemPoolSetAccess | musa_runtime_api.h |
musaMemPoolGetAccess | musa_runtime_api.h |
musaMemPoolTrimTo | musa_runtime_api.h |
musaMemPoolImportFromShareableHandle | musa_runtime_api.h |
musaMemPoolExportToShareableHandle | musa_runtime_api.h |
musaMemPoolImportPointer | musa_runtime_api.h |
musaMemPoolExportPointer | musa_runtime_api.h |
musaDeviceGetDefaultMemPool | musa_runtime_api.h |
musaDeviceGetMemPool | musa_runtime_api.h |
musaDeviceSetMemPool | musa_runtime_api.h |
musaDeviceGraphMemTrim | musa_runtime_api.h |
musaDeviceGetGraphMemAttribute | musa_runtime_api.h |
musaDeviceSetGraphMemAttribute | musa_runtime_api.h |
musaStreamAddCallback | musa_runtime_api.h |
musaStreamCreate | musa_runtime_api.h |
musaStreamBeginCapture | musa_runtime_api.h |
musaStreamBeginCaptureToGraph | musa_runtime_api.h |
musaThreadExchangeStreamCaptureMode | musa_runtime_api.h |
musaStreamEndCapture | musa_runtime_api.h |
musaStreamIsCapturing | musa_runtime_api.h |
musaStreamGetCaptureInfo_v2 | musa_runtime_api.h |
musaStreamGetCaptureInfo_v3 | musa_runtime_api.h |
musaStreamGetCaptureInfo | musa_runtime_api.h |
musaStreamUpdateCaptureDependencies | musa_runtime_api.h |
musaStreamCreateWithFlags | musa_runtime_api.h |
musaStreamCreateWithPriority | musa_runtime_api.h |
musaStreamDestroy | musa_runtime_api.h |
musaStreamQuery | musa_runtime_api.h |
musaStreamSynchronize | musa_runtime_api.h |
musaStreamWaitEvent | musa_runtime_api.h |
musaStreamGetFlags | musa_runtime_api.h |
musaStreamGetPriority | musa_runtime_api.h |
musaStreamGetId | musa_runtime_api.h |
musaStreamGetDevice | musa_runtime_api.h |
musaStreamAttachMemAsync | musa_runtime_api.h |
musaStreamSetAttribute | musa_runtime_api.h |
musaStreamGetAttribute | musa_runtime_api.h |
musaStreamCopyAttributes | musa_runtime_api.h |
musaCtxResetPersistingL2Cache | musa_runtime_api.h |
musaCreateTextureObject | musa_runtime_api.h |
musaDestroyTextureObject | musa_runtime_api.h |
musaGetTextureObjectResourceDesc | musa_runtime_api.h |
musaGetTextureObjectTextureDesc | musa_runtime_api.h |
musaGetTextureObjectResourceViewDesc | musa_runtime_api.h |
musaCreateChannelDesc | musa_runtime_api.h |
musaGetChannelDesc | musa_runtime_api.h |
musaCreateSurfaceObject | musa_runtime_api.h |
musaDestroySurfaceObject | musa_runtime_api.h |
musaGetSurfaceObjectResourceDesc | musa_runtime_api.h |
musaDriverGetVersion | musa_runtime_api.h |
musaRuntimeGetVersion | musa_runtime_api.h |
musaImportExternalSemaphore | musa_runtime_api.h |
musaSignalExternalSemaphoresAsync_v2 | musa_runtime_api.h |
musaWaitExternalSemaphoresAsync_v2 | musa_runtime_api.h |
musaDestroyExternalSemaphore | musa_runtime_api.h |
musaImportExternalMemory | musa_runtime_api.h |
musaExternalMemoryGetMappedBuffer | musa_runtime_api.h |
musaExternalMemoryGetMappedMipmappedArray | musa_runtime_api.h |
musaDestroyExternalMemory | musa_runtime_api.h |
musaGraphicsGLRegisterImage | musa_gl_interop.h |
musaGraphicsSubResourceGetMappedArray | musa_runtime_api.h |
musaGraphAddNode_v2 | musa_runtime_api.h |
musaGraphGetEdges_v2 | musa_runtime_api.h |
musaGraphNodeGetDependentNodes_v2 | musa_runtime_api.h |
musaGraphAddDependencies_v2 | musa_runtime_api.h |
musaGraphRemoveDependencies_v2 | musa_runtime_api.h |
musaGraphInstantiateWithParams | musa_runtime_api.h |
musaGraphicsResourceGetMappedMipmappedArray | musa_runtime_api.h |
musaGraphAddExternalSemaphoresSignalNode | musa_runtime_api.h |
musaGraphExternalSemaphoresSignalNodeGetParams | musa_runtime_api.h |
musaGraphExternalSemaphoresSignalNodeSetParams | musa_runtime_api.h |
musaGraphAddExternalSemaphoresWaitNode | musa_runtime_api.h |
musaGraphExternalSemaphoresWaitNodeGetParams | musa_runtime_api.h |
musaGraphExternalSemaphoresWaitNodeSetParams | musa_runtime_api.h |
musaGraphExecExternalSemaphoresSignalNodeSetParams | musa_runtime_api.h |
musaGraphExecExternalSemaphoresWaitNodeSetParams | musa_runtime_api.h |
musaKernelSetAttributeForDevice | musa_runtime_api.h |
musaLibraryEnumerateKernels | musa_runtime_api.h |
musaLibraryGetGlobal | musa_runtime_api.h |
musaLibraryGetKernel | musa_runtime_api.h |
musaLibraryGetKernelCount | musa_runtime_api.h |
musaLibraryGetManaged | musa_runtime_api.h |
musaLibraryGetUnifiedFunction | musa_runtime_api.h |
musaLibraryLoadData | musa_runtime_api.h |
musaLibraryLoadFromFile | musa_runtime_api.h |
musaLibraryUnload | musa_runtime_api.h |
API Function Reference
__musaPushCallConfiguration
Header: device_functions.h
unsigned __musaPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem, void *stream)
Pushes a kernel launch configuration for the MUSA runtime.
This exported runtime helper records the grid, block, shared-memory, and stream configuration used by the runtime launch path. gridDim Grid dimensions for the launch. blockDim Block dimensions for the launch. sharedMem Dynamic shared memory size in bytes. stream Stream used for the launch. Runtime launch-configuration status.
Parameters:
dim3 gridDim: Grid dimensions for the launch.dim3 blockDim: Block dimensions for the launch.size_t sharedMem: Dynamic shared memory size in bytes.void * stream: Stream used for the launch.
Returns:
Runtime launch-configuration status.
__musaPopCallConfiguration
Header: host_runtime.h
musaError_t MUSARTAPI __musaPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, void *stream)
Pops a kernel launch configuration for the MUSA runtime.
gridDim Returned grid dimensions. blockDim Returned block dimensions. sharedMem Returned dynamic shared memory size in bytes. stream Returned stream. musaSuccess or a Runtime error code.
Parameters:
dim3 * gridDim: Returned grid dimensions.dim3 * blockDim: Returned block dimensions.size_t * sharedMem: Returned dynamic shared memory size in bytes.void * stream: Returned stream.
Returns:
musaSuccess or a Runtime error code.
__musaRegisterFatBinary
Header: host_runtime.h
void **MUSARTAPI __musaRegisterFatBinary(void *fatMubin)
Registers a fat binary with the MUSA runtime.
fatMubin Fat binary data. Runtime fat-binary handle.
Parameters:
void * fatMubin: Fat binary data.
Returns:
Runtime fat-binary handle.
__musaRegisterFatBinaryEnd
Header: host_runtime.h
void MUSARTAPI __musaRegisterFatBinaryEnd(void **fatMubinHandle)
Completes fat binary registration with the MUSA runtime.
fatMubinHandle Runtime fat-binary handle.
Parameters:
void ** fatMubinHandle: Runtime fat-binary handle.
__musaRegisterFunction
Header: host_runtime.h
void MUSARTAPI __musaRegisterFunction(void **fatMubinHandle, const char *hostFun, char *deviceFun, const char *deviceName, int thread_limit, uint3 *tid, uint3 *bid, dim3 *bDim, dim3 *gDim, int *wSize)
Registers a kernel function with the MUSA runtime.
fatMubinHandle Runtime fat-binary handle. hostFun Host function pointer. deviceFun Device function pointer. deviceName Device-side function name. thread_limit Thread limit. tid Thread index metadata. bid Block index metadata. bDim Block dimension metadata. gDim Grid dimension metadata. wSize Warp-size metadata.
Parameters:
void ** fatMubinHandle: Runtime fat-binary handle.const char * hostFun: Host function pointer.char * deviceFun: Device function pointer.const char * deviceName: Device-side function name.int thread_limit: Thread limit.uint3 * tid: Thread index metadata.uint3 * bid: Block index metadata.dim3 * bDim: Block dimension metadata.dim3 * gDim: Grid dimension metadata.int * wSize: Warp-size metadata.
__musaRegisterVar
Header: host_runtime.h
void MUSARTAPI __musaRegisterVar(void **fatMubinHandle, char *hostVar, char *deviceAddress, const char *deviceName, int ext, size_t size, int constant, int global)
Registers a device variable with the MUSA runtime.
fatMubinHandle Runtime fat-binary handle. hostVar Host variable address. deviceAddress Device variable address. deviceName Device-side variable name. ext External linkage flag. size Variable size in bytes. constant Constant-memory flag. global Global-memory flag.
Parameters:
void ** fatMubinHandle: Runtime fat-binary handle.char * hostVar: Host variable address.char * deviceAddress: Device variable address.const char * deviceName: Device-side variable name.int ext: External linkage flag.size_t size: Variable size in bytes.int constant: Constant-memory flag.int global: Global-memory flag.
__musaRegisterTexture
Header: host_runtime.h
void MUSARTAPI __musaRegisterTexture(void **fatMubinHandle, const struct textureReference *hostVar, const void **deviceAddress, const char *deviceName, int dim, int norm, int ext)
Registers a texture reference with the MUSA runtime.
fatMubinHandle Runtime fat-binary handle. hostVar Host texture reference. deviceAddress Device texture address. deviceName Device-side texture name. dim Texture dimensionality. norm Normalization flag. ext External linkage flag.
Parameters:
void ** fatMubinHandle: Runtime fat-binary handle.const struct textureReference * hostVar: Host texture reference.const void ** deviceAddress: Device texture address.const char * deviceName: Device-side texture name.int dim: Texture dimensionality.int norm: Normalization flag.int ext: External linkage flag.
__musaRegisterSurface
Header: host_runtime.h
void MUSARTAPI __musaRegisterSurface(void **fatMubinHandle, const struct surfaceReference *hostVar, const void **deviceAddress, const char *deviceName, int dim, int ext)
Registers a surface reference with the MUSA runtime.
fatMubinHandle Runtime fat-binary handle. hostVar Host surface reference. deviceAddress Device surface address. deviceName Device-side surface name. dim Surface dimensionality. ext External linkage flag.
Parameters:
void ** fatMubinHandle: Runtime fat-binary handle.const struct surfaceReference * hostVar: Host surface reference.const void ** deviceAddress: Device surface address.const char * deviceName: Device-side surface name.int dim: Surface dimensionality.int ext: External linkage flag.
__musaUnregisterFatBinary
Header: host_runtime.h
void MUSARTAPI __musaUnregisterFatBinary(void **fatMubinHandle)
Unregisters a fat binary from the MUSA runtime.
fatMubinHandle Runtime fat-binary handle.
Parameters:
void ** fatMubinHandle: Runtime fat-binary handle.
musaThreadExit
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaThreadExit(void)
Exit and clean up from MUSA launches.
Deprecated Note that this function is deprecated because its name does not reflect its behavior. Its functionality is identical to the non-deprecated function musaDeviceReset(), which should be used instead. Explicitly destroys all cleans up all resources associated with the current device in the current process. Any subsequent API call to this device will reinitialize the device. Note that this function will reset the device immediately. It is the caller's responsibility to ensure that the device is not being accessed by any other host threads from the process when this function is called. musaSuccess musaDeviceReset
Returns:
musaSuccess
See also:
musaDeviceReset
musaThreadSynchronize
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaThreadSynchronize(void)
Wait for compute device to finish.
Deprecated Note that this function is deprecated because its name does not reflect its behavior. Its functionality is similar to the non-deprecated function musaDeviceSynchronize(), which should be used instead. Blocks until the device has completed all preceding requested tasks. musaThreadSynchronize() returns an error if one of the preceding tasks has failed. If the musaDeviceScheduleBlockingSync flag was set for this device, the host thread will block until the device has finished its work. musaSuccess musaDeviceSynchronize
Returns:
musaSuccess
See also:
musaDeviceSynchronize
musaThreadSetLimit
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaThreadSetLimit(enum musaLimit limit, size_t value)
Set resource limits.
Deprecated Note that this function is deprecated because its name does not reflect its behavior. Its functionality is identical to the non-deprecated function musaDeviceSetLimit(), which should be used instead. Setting limit to value is a request by the application to update the current limit maintained by the device. The driver is free to modify the requested value to meet h/w requirements (this could be clamping to minimum or maximum values, rounding up to nearest element size, etc). The application can use musaThreadGetLimit() to find out exactly what the limit has been set to. Setting each musaLimit has its own specific restrictions, so each is discussed here. musaLimitStackSize controls the stack size of each GPU thread. musaLimitPrintfFifoSize controls the size of the shared FIFO used by the printf() device system call. Setting musaLimitPrintfFifoSize must be performed before launching any kernel that uses the printf() device system call, otherwise musaErrorInvalidValue will be returned. musaLimitMallocHeapSize controls the size of the heap used by the malloc() and free() device system calls. Setting musaLimitMallocHeapSize must be performed before launching any kernel that uses the malloc() or free() device system calls, otherwise musaErrorInvalidValue will be returned. limit - Limit to set value - Size in bytes of limit musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue musaDeviceSetLimit
Parameters:
enum musaLimit limit: - Limit to setsize_t value: - Size in bytes of limit
Returns:
musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue
See also:
musaDeviceSetLimit
musaThreadGetLimit
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaThreadGetLimit(size_t *pValue, enum musaLimit limit)
Returns resource limits.
Deprecated Note that this function is deprecated because its name does not reflect its behavior. Its functionality is identical to the non-deprecated function musaDeviceGetLimit(), which should be used instead. Returns in *pValue the current size of limit. The supported musaLimit values are: musaLimitStackSize: stack size of each GPU thread; musaLimitPrintfFifoSize: size of the shared FIFO used by the printf() device system call. musaLimitMallocHeapSize: size of the heap used by the malloc() and free() device system calls; limit - Limit to query pValue - Returned size in bytes of limit musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue musaDeviceGetLimit
Parameters:
size_t * pValue: - Returned size in bytes of limitenum musaLimit limit: - Limit to query
Returns:
musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue
See also:
musaDeviceGetLimit
musaThreadGetCacheConfig
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaThreadGetCacheConfig(enum musaFuncCache *pCacheConfig)
Returns the preferred cache configuration for the current device.
Deprecated Note that this function is deprecated because its name does not reflect its behavior. Its functionality is identical to the non-deprecated function musaDeviceGetCacheConfig(), which should be used instead. On devices where the L1 cache and shared memory use the same hardware resources, this returns through pCacheConfig the preferred cache configuration for the current device. This is only a preference. The runtime will use the requested configuration if possible, but it is free to choose a different configuration if required to execute functions. This will return a pCacheConfig of musaFuncCachePreferNone on devices where the size of the L1 cache and shared memory are fixed. The supported cache configurations are: musaFuncCachePreferNone: no preference for shared memory or L1 (default) musaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache musaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory pCacheConfig - Returned cache configuration musaSuccess musaDeviceGetCacheConfig
Parameters:
enum musaFuncCache * pCacheConfig: - Returned cache configuration
Returns:
musaSuccess
See also:
musaDeviceGetCacheConfig
musaThreadSetCacheConfig
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaThreadSetCacheConfig(enum musaFuncCache cacheConfig)
Sets the preferred cache configuration for the current device.
Deprecated Note that this function is deprecated because its name does not reflect its behavior. Its functionality is identical to the non-deprecated function musaDeviceSetCacheConfig(), which should be used instead. On devices where the L1 cache and shared memory use the same hardware resources, this sets through cacheConfig the preferred cache configuration for the current device. This is only a preference. The runtime will use the requested configuration if possible, but it is free to choose a different configuration if required to execute the function. Any function preference set via musaFuncSetCacheConfig (C API) or musaFuncSetCacheConfig (C++ API) will be preferred over this device-wide setting. Setting the device-wide cache configuration to musaFuncCachePreferNone will cause subsequent kernel launches to prefer to not change the cache configuration unless required to launch the kernel. This setting does nothing on devices where the size of the L1 cache and shared memory are fixed. Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point. The supported cache configurations are: musaFuncCachePreferNone: no preference for shared memory or L1 (default) musaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache musaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory cacheConfig - Requested cache configuration musaSuccess musaDeviceSetCacheConfig
Parameters:
enum musaFuncCache cacheConfig: - Requested cache configuration
Returns:
musaSuccess
See also:
musaDeviceSetCacheConfig
musaBindTexture
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaBindTexture(size_t *offset, const struct textureReference *texref, const void *devPtr, const struct musaChannelFormatDesc *desc, size_t size __dv(UINT_MAX))
Binds a memory area to a texture.
Deprecated Binds size bytes of the memory area pointed to by devPtr to the texture reference texref. desc describes how the memory is interpreted when fetching values from the texture. Any memory previously bound to texref is unbound. Since the hardware enforces an alignment requirement on texture base addresses, musaBindTexture() returns in *offset a byte offset that must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel size and passed to kernels that read from the texture so they can be applied to the tex1Dfetch() function. If the device memory pointer was returned from musaMalloc(), the offset is guaranteed to be 0 and NULL may be passed as the offset parameter. The total number of elements (or texels) in the linear address range cannot exceed musaDevicePropmaxTexture1DLinear[0]. The number of elements is computed as (size / elementSize), where elementSize is determined from desc. offset - Offset in bytes texref - Texture to bind devPtr - Memory area on device desc - Channel format size - Size of the memory area pointed to by devPtr musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C++ API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetAddress, muTexRefSetAddressMode, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetBorderColor
Parameters:
size_t * offset: - Offset in bytesconst struct textureReference * texref: - Texture to bindconst void * devPtr: - Memory area on deviceconst struct musaChannelFormatDesc * desc: - Channel formatsize_t size __dv
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture
See also:
musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C++ API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetAddress, muTexRefSetAddressMode, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetBorderColor
musaUnbindTexture
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaUnbindTexture(const struct textureReference *texref)
Unbinds a texture.
Deprecated Unbinds the texture bound to texref. If texref is not currently bound, no operation is performed. texref - Texture to unbind musaSuccess, musaErrorInvalidTexture musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C++ API), musaGetTextureAlignmentOffset (C API)
Parameters:
const struct textureReference * texref: - Texture to unbind
Returns:
musaSuccess, musaErrorInvalidTexture
See also:
musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C++ API), musaGetTextureAlignmentOffset (C API)
musaBindTexture2D
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaBindTexture2D(size_t *offset, const struct textureReference *texref, const void *devPtr, const struct musaChannelFormatDesc *desc, size_t width, size_t height, size_t pitch)
Binds a 2D memory area to a texture.
Deprecated Binds the 2D memory area pointed to by devPtr to the texture reference texref. The size of the area is constrained by width in texel units, height in texel units, and pitch in byte units. desc describes how the memory is interpreted when fetching values from the texture. Any memory previously bound to texref is unbound. Since the hardware enforces an alignment requirement on texture base addresses, musaBindTexture2D() returns in *offset a byte offset that must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel size and passed to kernels that read from the texture so they can be applied to the tex2D() function. If the device memory pointer was returned from musaMalloc(), the offset is guaranteed to be 0 and NULL may be passed as the offset parameter. width and height, which are specified in elements (or texels), cannot exceed musaDevicePropmaxTexture2DLinear[0] and musaDevicePropmaxTexture2DLinear[1] respectively. pitch, which is specified in bytes, cannot exceed musaDevicePropmaxTexture2DLinear[2]. The driver returns musaErrorInvalidValue if pitch is not a multiple of musaDeviceProptexturePitchAlignment. offset - Offset in bytes texref - Texture reference to bind devPtr - 2D memory area on device desc - Channel format width - Width in texel units height - Height in texel units pitch - Pitch in bytes musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C++ API), musaBindTexture2D (C++ API, inherited channel descriptor), musaBindTextureToArray (C API), musaBindTextureToArray (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetAddress2D, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetAddressMode, muTexRefSetBorderColor
Parameters:
size_t * offset: - Offset in bytesconst struct textureReference * texref: - Texture reference to bindconst void * devPtr: - 2D memory area on deviceconst struct musaChannelFormatDesc * desc: - Channel formatsize_t width: - Width in texel unitssize_t height: - Height in texel unitssize_t pitch: - Pitch in bytes
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture
See also:
musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C++ API), musaBindTexture2D (C++ API, inherited channel descriptor), musaBindTextureToArray (C API), musaBindTextureToArray (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetAddress2D, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetAddressMode, muTexRefSetBorderColor
musaBindTextureToArray
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaBindTextureToArray(const struct textureReference *texref, musaArray_const_t array, const struct musaChannelFormatDesc *desc)
Binds an array to a texture.
Deprecated Binds the MUSA array array to the texture reference texref. desc describes how the memory is interpreted when fetching values from the texture. Any MUSA array previously bound to texref is unbound. texref - Texture to bind array - Memory array on device desc - Channel format musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C++ API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetArray, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetAddressMode, muTexRefSetFilterMode, muTexRefSetBorderColor, muTexRefSetMaxAnisotropy
Parameters:
const struct textureReference * texref: - Texture to bindmusaArray_const_t array: - Memory array on deviceconst struct musaChannelFormatDesc * desc: - Channel format
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture
See also:
musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C++ API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetArray, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetAddressMode, muTexRefSetFilterMode, muTexRefSetBorderColor, muTexRefSetMaxAnisotropy
musaGetTextureAlignmentOffset
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaGetTextureAlignmentOffset(size_t *offset, const struct textureReference *texref)
Get the alignment offset of a texture.
Deprecated Returns in *offset the offset that was returned when texture reference texref was bound. offset - Offset of texture reference in bytes texref - Texture to get offset of musaSuccess, musaErrorInvalidTexture, musaErrorInvalidTextureBinding musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C++ API)
Parameters:
size_t * offset: - Offset of texture reference in bytesconst struct textureReference * texref: - Texture to get offset of
Returns:
musaSuccess, musaErrorInvalidTexture, musaErrorInvalidTextureBinding
See also:
musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C++ API)
musaBindTextureToMipmappedArray
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaBindTextureToMipmappedArray(const struct textureReference *texref, musaMipmappedArray_const_t mipmappedArray, const struct musaChannelFormatDesc *desc)
Binds a mipmapped array to a texture.
Deprecated Binds the MUSA mipmapped array mipmappedArray to the texture reference texref. desc describes how the memory is interpreted when fetching values from the texture. Any MUSA mipmapped array previously bound to texref is unbound. texref - Texture to bind mipmappedArray - Memory mipmapped array on device desc - Channel format musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C++ API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetMipmappedArray, muTexRefSetMipmapFilterMode, muTexRefSetMipmapLevelClamp, muTexRefSetMipmapLevelBias, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetAddressMode, muTexRefSetBorderColor, muTexRefSetMaxAnisotropy
Parameters:
const struct textureReference * texref: - Texture to bindmusaMipmappedArray_const_t mipmappedArray: - Memory mipmapped array on deviceconst struct musaChannelFormatDesc * desc: - Channel format
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidTexture
See also:
musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureReference, musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C++ API), musaUnbindTexture (C API), musaGetTextureAlignmentOffset (C API), muTexRefSetMipmappedArray, muTexRefSetMipmapFilterMode, muTexRefSetMipmapLevelClamp, muTexRefSetMipmapLevelBias, muTexRefSetFormat, muTexRefSetFlags, muTexRefSetAddressMode, muTexRefSetBorderColor, muTexRefSetMaxAnisotropy
musaGetTextureReference
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaGetTextureReference(const struct textureReference **texref, const void *symbol)
Get the texture reference associated with a symbol.
Deprecated Returns in *texref the structure associated to the texture reference defined by symbol symbol. texref - Texture reference associated with symbol symbol - Texture to get reference for musaSuccess, musaErrorInvalidTexture musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureAlignmentOffset (C API), musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C API), muModuleGetTexRef
Parameters:
const struct textureReference ** texref: - Texture reference associated with symbolconst void * symbol: - Texture to get reference for
Returns:
musaSuccess, musaErrorInvalidTexture
See also:
musaCreateChannelDesc (C API), musaGetChannelDesc, musaGetTextureAlignmentOffset (C API), musaBindTexture (C API), musaBindTexture2D (C API), musaBindTextureToArray (C API), musaUnbindTexture (C API), muModuleGetTexRef
musaBindSurfaceToArray
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaBindSurfaceToArray(const struct surfaceReference *surfref, musaArray_const_t array, const struct musaChannelFormatDesc *desc)
Binds an array to a surface.
Deprecated Binds the MUSA array array to the surface reference surfref. desc describes how the memory is interpreted when fetching values from the surface. Any MUSA array previously bound to surfref is unbound. surfref - Surface to bind array - Memory array on device desc - Channel format musaSuccess, musaErrorInvalidValue, musaErrorInvalidSurface musaBindSurfaceToArray (C++ API), musaBindSurfaceToArray (C++ API, inherited channel descriptor), musaGetSurfaceReference, muSurfRefSetArray
Parameters:
const struct surfaceReference * surfref: - Surface to bindmusaArray_const_t array: - Memory array on deviceconst struct musaChannelFormatDesc * desc: - Channel format
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidSurface
See also:
musaBindSurfaceToArray (C++ API), musaBindSurfaceToArray (C++ API, inherited channel descriptor), musaGetSurfaceReference, muSurfRefSetArray
musaGetSurfaceReference
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaGetSurfaceReference(const struct surfaceReference **surfref, const void *symbol)
Get the surface reference associated with a symbol.
Deprecated Returns in *surfref the structure associated to the surface reference defined by symbol symbol. surfref - Surface reference associated with symbol symbol - Surface to get reference for musaSuccess, musaErrorInvalidSurface musaBindSurfaceToArray (C API), muModuleGetSurfRef
Parameters:
const struct surfaceReference ** surfref: - Surface reference associated with symbolconst void * symbol: - Surface to get reference for
Returns:
musaSuccess, musaErrorInvalidSurface
See also:
musaBindSurfaceToArray (C API), muModuleGetSurfRef
musaMemcpyFromArray
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaMemcpyFromArray(void *dst, musaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum musaMemcpyKind kind)
Copies data between host and device.
Deprecated Copies count bytes from the MUSA array src starting at hOffset rows and wOffset bytes from the upper left corner to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of musaMemcpyHostToHost, musaMemcpyHostToDevice, musaMemcpyDeviceToHost, musaMemcpyDeviceToDevice, or musaMemcpyDefault. Passing musaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, musaMemcpyDefault is only allowed on systems that support unified virtual addressing. dst - Destination memory address src - Source memory address wOffset - Source starting X offset (columns in bytes) hOffset - Source starting Y offset (rows) count - Size in bytes to copy kind - Type of transfer musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyAtoH, muMemcpyAtoD
Parameters:
void * dst: - Destination memory addressmusaArray_const_t src: - Source memory addresssize_t wOffset: - Source starting X offset (columns in bytes)size_t hOffset: - Source starting Y offset (rows)size_t count: - Size in bytes to copyenum musaMemcpyKind kind: - Type of transfer
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection
See also:
musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyAtoH, muMemcpyAtoD
musaMemcpyFromArrayAsync
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaMemcpyFromArrayAsync(void *dst, musaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum musaMemcpyKind kind, musaStream_t stream __dv(0))
Copies data between host and device.
Deprecated Copies count bytes from the MUSA array src starting at hOffset rows and wOffset bytes from the upper left corner to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of musaMemcpyHostToHost, musaMemcpyHostToDevice, musaMemcpyDeviceToHost, musaMemcpyDeviceToDevice, or musaMemcpyDefault. Passing musaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, musaMemcpyDefault is only allowed on systems that support unified virtual addressing. musaMemcpyFromArrayAsync() is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero stream argument. If kind is musaMemcpyHostToDevice or musaMemcpyDeviceToHost and stream is non-zero, the copy may overlap with operations in other streams. dst - Destination memory address src - Source memory address wOffset - Source starting X offset (columns in bytes) hOffset - Source starting Y offset (rows) count - Size in bytes to copy kind - Type of transfer stream - Stream identifier musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyAtoHAsync, muMemcpy2DAsync
Parameters:
void * dst: - Destination memory addressmusaArray_const_t src: - Source memory addresssize_t wOffset: - Source starting X offset (columns in bytes)size_t hOffset: - Source starting Y offset (rows)size_t count: - Size in bytes to copyenum musaMemcpyKind kind: - Type of transfermusaStream_t stream __dv
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection
See also:
musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyAtoHAsync, muMemcpy2DAsync
musaMemcpyToArray
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaMemcpyToArray(musaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum musaMemcpyKind kind)
Copies data between host and device.
Deprecated Copies count bytes from the memory area pointed to by src to the MUSA array dst starting at hOffset rows and wOffset bytes from the upper left corner, where kind specifies the direction of the copy, and must be one of musaMemcpyHostToHost, musaMemcpyHostToDevice, musaMemcpyDeviceToHost, musaMemcpyDeviceToDevice, or musaMemcpyDefault. Passing musaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, musaMemcpyDefault is only allowed on systems that support unified virtual addressing. dst - Destination memory address wOffset - Destination starting X offset (columns in bytes) hOffset - Destination starting Y offset (rows) src - Source memory address count - Size in bytes to copy kind - Type of transfer musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection musaMemcpy, musaMemcpy2D, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyHtoA, muMemcpyDtoA
Parameters:
musaArray_t dst: - Destination memory addresssize_t wOffset: - Destination starting X offset (columns in bytes)size_t hOffset: - Destination starting Y offset (rows)const void * src: - Source memory addresssize_t count: - Size in bytes to copyenum musaMemcpyKind kind: - Type of transfer
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection
See also:
musaMemcpy, musaMemcpy2D, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyHtoA, muMemcpyDtoA
musaMemcpyToArrayAsync
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaMemcpyToArrayAsync(musaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum musaMemcpyKind kind, musaStream_t stream __dv(0))
Copies data between host and device.
Deprecated Copies count bytes from the MUSA array src starting at hOffsetSrc rows and wOffsetSrc bytes from the upper left corner to the MUSA array dst starting at hOffsetDst rows and wOffsetDst bytes from the upper left corner, where kind specifies the direction of the copy, and must be one of musaMemcpyHostToHost, musaMemcpyHostToDevice, musaMemcpyDeviceToHost, musaMemcpyDeviceToDevice, or musaMemcpyDefault. Passing musaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, musaMemcpyDefault is only allowed on systems that support unified virtual addressing. dst - Destination memory address wOffsetDst - Destination starting X offset (columns in bytes) hOffsetDst - Destination starting Y offset (rows) src - Source memory address wOffsetSrc - Source starting X offset (columns in bytes) hOffsetSrc - Source starting Y offset (rows) count - Size in bytes to copy kind - Type of transfer musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyAtoA Copies data between host and device Deprecated Copies count bytes from the memory area pointed to by src to the MUSA array dst starting at hOffset rows and wOffset bytes from the upper left corner, where kind specifies the direction of the copy, and must be one of musaMemcpyHostToHost, musaMemcpyHostToDevice, musaMemcpyDeviceToHost, musaMemcpyDeviceToDevice, or musaMemcpyDefault. Passing musaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, musaMemcpyDefault is only allowed on systems that support unified virtual addressing. musaMemcpyToArrayAsync() is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero stream argument. If kind is musaMemcpyHostToDevice or musaMemcpyDeviceToHost and stream is non-zero, the copy may overlap with operations in other streams. dst - Destination memory address wOffset - Destination starting X offset (columns in bytes) hOffset - Destination starting Y offset (rows) src - Source memory address count - Size in bytes to copy kind - Type of transfer stream - Stream identifier musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyHtoAAsync, muMemcpy2DAsync
Parameters:
musaArray_t dst: - Destination memory addresssize_t wOffset: - Destination starting X offset (columns in bytes)size_t hOffset: - Destination starting Y offset (rows)const void * src: - Source memory addresssize_t count: - Size in bytes to copyenum musaMemcpyKind kind: - Type of transfermusaStream_t stream __dv
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection musaSuccess, musaErrorInvalidValue, musaErrorInvalidMemcpyDirection
See also:
musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpyToArrayAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyAtoA musaMemcpy, musaMemcpy2D, musaMemcpyToArray, musaMemcpy2DToArray, musaMemcpyFromArray, musaMemcpy2DFromArray, musaMemcpyArrayToArray, musaMemcpy2DArrayToArray, musaMemcpyToSymbol, musaMemcpyFromSymbol, musaMemcpyAsync, musaMemcpy2DAsync, musaMemcpy2DToArrayAsync, musaMemcpyFromArrayAsync, musaMemcpy2DFromArrayAsync, musaMemcpyToSymbolAsync, musaMemcpyFromSymbolAsync, muMemcpyHtoAAsync, muMemcpy2DAsync
musaDeviceGetPCIBusId
Header: musa_runtime_api.h
__host__ musaError_t MUSARTAPI musaDeviceGetPCIBusId(char *pciBusId, int len, int device)
Returns a PCI Bus Id string for the device.
Returns an ASCII string identifying the device dev in the NULL-terminated string pointed to by pciBusId. len specifies the maximum length of the string that may be returned. pciBusId - Returned identifier string for the device in the following format where domain, bus, device, and function are all hexadecimal values. pciBusId should be large enough to store 13 characters including the NULL-terminator. len - Maximum length of string to store in name device - Device to get identifier string for musaSuccess, musaErrorInvalidValue, musaErrorInvalidDevice musaDeviceGetByPCIBusId, muDeviceGetPCIBusId
Parameters:
char * pciBusId: - Returned identifier string for the device in the following formatint len: - Maximum length of string to store in nameint device: - Device to get identifier string for
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidDevice
See also:
musaDeviceGetByPCIBusId, muDeviceGetPCIBusId
musaDeviceGetByPCIBusId
Header: musa_runtime_api.h
__host__ musaError_t MUSARTAPI musaDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
Returns in *device a device ordinal given a PCI bus ID string. device - Returned device ordinal pciBusId - String in one of the following forms: where domain, bus, device, and function are all hexadecimal values musaSuccess, musaErrorInvalidValue, musaErrorInvalidDevice musaDeviceGetPCIBusId, muDeviceGetByPCIBusId
Parameters:
int * device: - Returned device ordinalconst char * pciBusId: - String in one of the following forms:
Returns:
musaSuccess, musaErrorInvalidValue, musaErrorInvalidDevice
See also:
musaDeviceGetPCIBusId, muDeviceGetByPCIBusId
musaDeviceGetLimit
Header: musa_runtime_api.h
__host__ __musart_builtin__ musaError_t MUSARTAPI musaDeviceGetLimit(size_t *pValue, enum musaLimit limit)
Return resource limits.
Returns in *pValue the current size of limit. The following musaLimit values are supported. musaLimitStackSize is the stack size in bytes of each GPU thread. musaLimitPrintfFifoSize is the size in bytes of the shared FIFO used by the printf() device system call. musaLimitMallocHeapSize is the size in bytes of the heap used by the malloc() and free() device system calls. musaLimitDevRuntimeSyncDepth is the maximum grid depth at which a thread can isssue the device runtime call musaDeviceSynchronize() to wait on child grid launches to complete. This functionality is removed for devices of compute capability >= 9.0, and hence will return error musaErrorUnsupportedLimit on such devices. musaLimitDevRuntimePendingLaunchCount is the maximum number of outstanding device runtime launches. musaLimitMaxL2FetchGranularity is the L2 cache fetch granularity. musaLimitPersistingL2CacheSize is the persisting L2 cache size in bytes. limit - Limit to query pValue - Returned size of the limit musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue musaDeviceSetLimit, muCtxGetLimit
Parameters:
size_t * pValue: - Returned size of the limitenum musaLimit limit: - Limit to query
Returns:
musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue
See also:
musaDeviceSetLimit, muCtxGetLimit
musaDeviceSetLimit
Header: musa_runtime_api.h
__host__ musaError_t MUSARTAPI musaDeviceSetLimit(enum musaLimit limit, size_t value)
Set resource limits.
Setting limit to value is a request by the application to update the current limit maintained by the device. The driver is free to modify the requested value to meet h/w requirements (this could be clamping to minimum or maximum values, rounding up to nearest element size, etc). The application can use musaDeviceGetLimit() to find out exactly what the limit has been set to. Setting each musaLimit has its own specific restrictions, so each is discussed here. musaLimitStackSize controls the stack size in bytes of each GPU thread. musaLimitPrintfFifoSize controls the size in bytes of the shared FIFO used by the printf() device system call. Setting musaLimitPrintfFifoSize must not be performed after launching any kernel that uses the printf() device system call - in such case musaErrorInvalidValue will be returned. musaLimitMallocHeapSize controls the size in bytes of the heap used by the malloc() and free() device system calls. Setting musaLimitMallocHeapSize must not be performed after launching any kernel that uses the malloc() or free() device system calls - in such case musaErrorInvalidValue will be returned. musaLimitDevRuntimeSyncDepth controls the maximum nesting depth of a grid at which a thread can safely call musaDeviceSynchronize(). Setting this limit must be performed before any launch of a kernel that uses the device runtime and calls musaDeviceSynchronize() above the default sync depth, two levels of grids. Calls to musaDeviceSynchronize() will fail with error code musaErrorSyncDepthExceeded if the limitation is violated. This limit can be set smaller than the default or up the maximum launch depth of 24. When setting this limit, keep in mind that additional levels of sync depth require the runtime to reserve large amounts of device memory which can no longer be used for user allocations. If these reservations of device memory fail, musaDeviceSetLimit will return musaErrorMemoryAllocation, and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability < 9.0. Attempting to set this limit on devices of other compute capability will results in error musaErrorUnsupportedLimit being returned. musaLimitDevRuntimePendingLaunchCount controls the maximum number of outstanding device runtime launches that can be made from the current device. A grid is outstanding from the point of launch up until the grid is known to have been completed. Device runtime launches which violate this limitation fail and return musaErrorLaunchPendingCountExceeded when musaGetLastError() is called after launch. If more pending launches than the default (2048 launches) are needed for a module using the device runtime, this limit can be increased. Keep in mind that being able to sustain additional pending launches will require the runtime to reserve larger amounts of device memory upfront which can no longer be used for allocations. If these reservations fail, musaDeviceSetLimit will return musaErrorMemoryAllocation, and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability 3.5 and higher. Attempting to set this limit on devices of compute capability less than 3.5 will result in the error musaErrorUnsupportedLimit being returned. musaLimitMaxL2FetchGranularity controls the L2 cache fetch granularity. Values can range from 0B to 128B. This is purely a performance hint and it can be ignored or clamped depending on the platform. musaLimitPersistingL2CacheSize controls size in bytes available for persisting L2 cache. This is purely a performance hint and it can be ignored or clamped depending on the platform. limit - Limit to set value - Size of limit musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue, musaErrorMemoryAllocation musaDeviceGetLimit, muCtxSetLimit
Parameters:
enum musaLimit limit: - Limit to setsize_t value: - Size of limit
Returns:
musaSuccess, musaErrorUnsupportedLimit, musaErrorInvalidValue, musaErrorMemoryAllocation
See also:
musaDeviceGetLimit, muCtxSetLimit
musaDeviceGetP2PAttribute
Header: musa_runtime_api.h
__host__ __musart_builtin__ musaError_t MUSARTAPI musaDeviceGetP2PAttribute(int *value, enum musaDeviceP2PAttr attr, int srcDevice, int dstDevice)
Return MtSciSync attributes that this device can support.
Returns in mtSciSyncAttrList, the properties of MtSciSync that this MUSA device, dev can support. The returned mtSciSyncAttrList can be used to create an MtSciSync that matches this device's capabilities. If MtSciSyncAttrKey_RequiredPerm field in mtSciSyncAttrList is already set this API will return musaErrorInvalidValue. The applications should set mtSciSyncAttrList to a valid MtSciSyncAttrList failing which this API will return musaErrorInvalidHandle. The flags controls how applications intends to use the MtSciSync created from the mtSciSyncAttrList. The valid flags are: musaMtSciSyncAttrSignal, specifies that the applications intends to signal an MtSciSync on this MUSA device. musaMtSciSyncAttrWait, specifies that the applications intends to wait on an MtSciSync on this MUSA device. At least one of these flags must be set, failing which the API returns musaErrorInvalidValue. Both the flags are orthogonal to one another: a developer may set both these flags that allows to set both wait and signal specific attributes in the same mtSciSyncAttrList. Note that this API updates the input mtSciSyncAttrList with values equivalent to the following public attribute key-values: MtSciSyncAttrKey_RequiredPerm is set to MtSciSyncAccessPerm_SignalOnly if musaMtSciSyncAttrSignal is set in flags. MtSciSyncAccessPerm_WaitOnly if musaMtSciSyncAttrWait is set in flags. MtSciSyncAccessPerm_WaitSignal if both musaMtSciSyncAttrWait and musaMtSciSyncAttrSignal are set in flags. MtSciSyncAttrKey_PrimitiveInfo is set to MtSciSyncAttrValPrimitiveType_SysmemSemaphore on any valid device. MtSciSyncAttrValPrimitiveType_Syncpoint if device is a Tegra device. MtSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if device is GA10X+. MtSciSyncAttrKey_GpuId is set to the same UUID that is returned in musaDeviceProp.uuid from musaDeviceGetProperties for this device. mtSciSyncAttrList - Return MtSciSync attributes supported. device - Valid Musa Device to get MtSciSync attributes for. flags - flags describing MtSciSync usage. musaSuccess, musaErrorDeviceUninitialized, musaErrorInvalidValue, musaErrorInvalidHandle, musaErrorInvalidDevice, musaErrorNotSupported, musaErrorMemoryAllocation musaImportExternalSemaphore, musaDestroyExternalSemaphore, musaSignalExternalSemaphoresAsync, musaWaitExternalSemaphoresAsync Queries attributes of the link between two devices. Returns in *value the value of the requested attribute attrib of the link between srcDevice and dstDevice. The supported attributes are: musaDevP2PAttrPerformanceRank: A relative value indicating the performance of the link between two devices. Lower value means better performance (0 being the value used for most performant link). musaDevP2PAttrAccessSupported: 1 if peer access is enabled. musaDevP2PAttrNativeAtomicSupported: 1 if native atomic operations over the link are supported. musaDevP2PAttrMusaArrayAccessSupported: 1 if accessing MUSA arrays over the link is supported. Returns musaErrorInvalidDevice if srcDevice or dstDevice are not valid or if they represent the same device. Returns musaErrorInvalidValue if attrib is not valid or if value is a null pointer. value - Returned value of the requested attribute attrib - The requested attribute of the link between srcDevice and dstDevice. srcDevice - The source device of the target link. dstDevice - The destination device of the target link. musaSuccess, musaErrorInvalidDevice, musaErrorInvalidValue musaDeviceEnablePeerAccess, musaDeviceDisablePeerAccess, musaDeviceCanAccessPeer, muDeviceGetP2PAttribute
Parameters:
int * value: - Returned value of the requested attributeenum musaDeviceP2PAttr attrint srcDevice: - The source device of the target link.int dstDevice: - The destination device of the target link.
Returns:
musaSuccess, musaErrorInvalidDevice, musaErrorInvalidValue
See also:
musaImportExternalSemaphore, musaDestroyExternalSemaphore, musaSignalExternalSemaphoresAsync, musaWaitExternalSemaphoresAsync musaDeviceEnablePeerAccess, musaDeviceDisablePeerAccess, musaDeviceCanAccessPeer, muDeviceGetP2PAttribute
musaDeviceGetSharedMemConfig
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ __musart_builtin__ musaError_t MUSARTAPI musaDeviceGetSharedMemConfig(enum musaSharedMemConfig *pConfig)
Returns the shared memory configuration for the current device.
Deprecated This function will return in pConfig the current size of shared memory banks on the current device. On devices with configurable shared memory banks, musaDeviceSetSharedMemConfig can be used to change this setting, so that all subsequent kernel launches will by default use the new bank size. When musaDeviceGetSharedMemConfig is called on devices without configurable shared memory, it will return the fixed bank size of the hardware. The returned bank configurations can be either: musaSharedMemBankSizeFourByte - shared memory bank width is four bytes. musaSharedMemBankSizeEightByte - shared memory bank width is eight bytes. pConfig - Returned cache configuration musaSuccess, musaErrorInvalidValue musaDeviceSetCacheConfig, musaDeviceGetCacheConfig, musaDeviceSetSharedMemConfig, musaFuncSetCacheConfig, muCtxGetSharedMemConfig
Parameters:
enum musaSharedMemConfig * pConfig: - Returned cache configuration
Returns:
musaSuccess, musaErrorInvalidValue
See also:
musaDeviceSetCacheConfig, musaDeviceGetCacheConfig, musaDeviceSetSharedMemConfig, musaFuncSetCacheConfig, muCtxGetSharedMemConfig
musaDeviceSetSharedMemConfig
Header: musa_runtime_api.h
__MUSA_DEPRECATED __host__ musaError_t MUSARTAPI musaDeviceSetSharedMemConfig(enum musaSharedMemConfig config)
Sets the shared memory configuration for the current device.
Deprecated On devices with configurable shared memory banks, this function will set the shared memory bank size which is used for all subsequent kernel launches. Any per-function setting of shared memory set via musaFuncSetSharedMemConfig will override the device wide setting. Changing the shared memory configuration between launches may introduce a device side synchronization point. Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what kinds of accesses to shared memory will result in bank conflicts. This function will do nothing on devices with fixed shared memory bank size. The supported bank configurations are: musaSharedMemBankSizeDefault: set bank width the device default (currently, four bytes) musaSharedMemBankSizeFourByte: set shared memory bank width to be four bytes natively. musaSharedMemBankSizeEightByte: set shared memory bank width to be eight bytes natively. config - Requested cache configuration musaSuccess, musaErrorInvalidValue musaDeviceSetCacheConfig, musaDeviceGetCacheConfig, musaDeviceGetSharedMemConfig, musaFuncSetCacheConfig, muCtxSetSharedMemConfig
Parameters:
enum musaSharedMemConfig config: - Requested cache configuration
Returns:
musaSuccess, musaErrorInvalidValue
See also:
musaDeviceSetCacheConfig, musaDeviceGetCacheConfig, musaDeviceGetSharedMemConfig, musaFuncSetCacheConfig, muCtxSetSharedMemConfig
musaDeviceGetStreamPriorityRange
Header: musa_runtime_api.h
__host__ __musart_builtin__ musaError_t MUSARTAPI musaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priorities.
Returns in *leastPriority and *greatestPriority the numerical values that correspond to the least and greatest stream priorities respectively. Stream priorities follow a convention where lower numbers imply greater priorities. The range of meaningful stream priorities is given by [ *greatestPriority, *leastPriority ]. If the user attempts to create a stream with a priority value that is outside the the meaningful range as specified by this API, the priority is automatically clamped down or up to either *leastPriority or *greatestPriority respectively. See musaStreamCreateWithPriority for details on creating a priority stream. A NULL may be passed in for *leastPriority or *greatestPriority if the value is not desired. This function will return '0' in both *leastPriority and *greatestPriority if the current context's device does not support stream priorities (see musaDeviceGetAttribute). leastPriority - Pointer to an int in which the numerical value for least stream priority is returned greatestPriority - Pointer to an int in which the numerical value for greatest stream priority is returned musaSuccess musaStreamCreateWithPriority, musaStreamGetPriority, muCtxGetStreamPriorityRange
Parameters:
int * leastPriority: - Pointer to an int in which the numerical value for least stream priority is returnedint * greatestPriority: - Pointer to an int in which the numerical value for greatest stream priority is returned
Returns:
musaSuccess
See also:
musaStreamCreateWithPriority, musaStreamGetPriority, muCtxGetStreamPriorityRange
musaDeviceReset
Header: musa_runtime_api.h
__host__ musaError_t MUSARTAPI musaDeviceReset(void)
Destroy all allocations and reset all state on the current device in the current process.
Explicitly destroys and cleans up all resources associated with the current device in the current process. It is the caller's responsibility to ensure that the resources are not accessed or passed in subsequent API calls and doing so will result in undefined behavior. These resources include MUSA types musaStream_t, musaEvent_t, musaArray_t, musaMipmappedArray_t, musaPitchedPtr, musaTextureObject_t, musaSurfaceObject_t, textureReference, surfaceReference, musaExternalMemory_t, musaExternalSemaphore_t and musaGraphicsResource_t. These resources also include memory allocations by musaMalloc, musaMallocHost, musaMallocManaged and musaMallocPitch. Any subsequent API call to this device will reinitialize the device. Note that this function will reset the device immediately. It is the caller's responsibility to ensure that the device is not being accessed by any other host threads from the process when this function is called. musaDeviceReset() will not destroy memory allocations by musaMallocAsync() and musaMallocFromPoolAsync(). These memory allocations need to be destroyed explicitly. If a non-primary MUcontext is current to the thread, musaDeviceReset() will destroy only the internal MUSA RT state for that MUcontext. musaSuccess musaDeviceSynchronize
Returns:
musaSuccess
See also:
musaDeviceSynchronize
musaDeviceSynchronize
Header: musa_runtime_api.h
__host__ __musart_builtin__ musaError_t MUSARTAPI musaDeviceSynchronize(void)
Wait for compute device to finish.
Blocks until the device has completed all preceding requested tasks. musaDeviceSynchronize() returns an error if one of the preceding tasks has failed. If the musaDeviceScheduleBlockingSync flag was set for this device, the host thread will block until the device has finished its work. musaSuccess musaDeviceReset, muCtxSynchronize
Returns:
musaSuccess
See also:
musaDeviceReset, muCtxSynchronize