Intel® FPGA SDK for OpenCL™ Pro Edition: Custom Platform Toolkit User Guide

ID 683085
Date 3/28/2022
Public
Document Table of Contents

2.3.24. aocl_mmd_shared_migrate

A call to the aocl_mmd_shared_migrate() function must be made for non-concurrent shared allocations any time the accessor of the allocation changes. For example, the aocl_mmd_shared_migrate() function should be called indicating that the allocation should be migrated to the device before a kernel accessing the allocation is launched on the device. Similarly, the aocl_mmd_shared_migrate() function should be called indicating that the allocation is migrated to the host before the host accesses the memory after kernel completion. For concurrent allocations, this call may be used as a performance hint, but it is not strictly required for functionality.

Syntax

int aocl_mmd_shared_migrate (int handle,
                             void* shared_ptr,
                             size_t size,
                             aocl_mmd_migrate_t destination);

Function Arguments

  • handle—Device that has access to this memory.
  • hared_ptr—Pointer allocated by the aocl_mmd_shared_alloc() function.
  • size—Size (in bytes) of the migration. Must be a multiple of a page boundary that the BSP supports.
  • destination—The destination of the migration.

Return Values

Returns one of the following error code:

  • AOCL_MMD_ERROR_SUCCESS—No error occurred.
  • AOCL_MMD_ERROR_INVALID_HANDLE—The device handle provided is invalid.
  • AOCL_MMD_ERROR_INVALID_MIGRATION_SIZE—The migration size is not supported by the device.