Skip to main content

cudaGetSymbolAddress

Function cudaGetSymbolAddress 

Source
pub unsafe extern "C" fn cudaGetSymbolAddress(
    devPtr: *mut *mut c_void,
    symbol: *const c_void,
) -> cudaError_t
Expand description

Finds the address associated with a CUDA symbol.

Returns in *devPtr the address of symbol symbol on the device. symbol is a variable that resides in global or constant memory space. If symbol cannot be found, or if symbol is not declared in the global or constant memory space, *devPtr is unchanged and the error cudaErrorInvalidSymbol is returned.

Note that this function may also return error codes from previous, asynchronous launches.

Note: Use of a string naming a variable as the symbol parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

§Parameters

  • devPtr: Return device pointer associated with symbol.
  • symbol: Device symbol address.

§Return value

See also: cudaGetSymbolAddress (C++ API), cudaGetSymbolSize (C API), cuModuleGetGlobal.