[][src]Function opencl3::memory::svm_alloc

pub fn svm_alloc(
    context: *mut c_void,
    flags: u64,
    size: usize,
    alignment: u32
) -> Result<*mut c_void, i32>

Allocate a shared virtual memory (SVM) buffer that can be shared by the host and all devices in an OpenCL context.
Calls clSVMAlloc.
CL_VERSION_2_0

  • context - a valid OpenCL context.
  • flags - a bit-field used to specify allocation and usage information, see: SVM Memory Flags.
  • size - the size in bytes of the SVM buffer to be allocated.
  • alignment - the minimum alignment in bytes that is required for the newly created buffers memory region.

returns Result containing the address of the SVM buffer or the error code: CL_INVALID_VALUE if the address is NULL.