logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

clEnqueueMigrateMemObjects - Enqueues a command to indicate which device a set of memory objects should

Authors

TheKhronosGroup

Errors

clEnqueueMigrateMemObjects returns CL_SUCCESS if the function is executed successfully. Otherwise, it
       returns one of the following errors:

       •   CL_INVALID_COMMAND_QUEUE if command_queue is not a valid command_queue.

       •   CL_INVALID_CONTEXT if the context associated with command_queue and memory objects in memobj are not
           the same or if the context associated with command_queue and events in event_wait_list are not the
           same.

       •   CL_INVALID_MEM_OBJECT if any of the memory objects in mem_objs is not a valid memory object.

       •   CL_INVALID_VALUE if num_mem_objects is zero or if mem_objects is NULL.

       •   CL_INVALID_VALUE if flags is not 0 or is not any of the values described in the table above.

       •   CL_INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or
           event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list
           are not valid events.

       •   CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for the specified set of
           memory objects in mem_objects.

       •   CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation
           on the device.

       •   CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL
           implementation on the host.

Name

       clEnqueueMigrateMemObjects - Enqueues a command to indicate which device a set of memory objects should
       be associated with.

       cl_intclEnqueueMigrateMemObjects(cl_command_queuecommand_queue,cl_uintnum_mem_objects,constcl_mem*mem_objects,cl_mem_migration_flagsflags,cl_uintnum_events_in_wait_list,constcl_event*event_wait_list,cl_event*event);

Notes

        1. OpenCL Specification
           page 123, section 5.4.4 - Migrating Memory Objects

The Khronos Group                                  11/18/2024                         CLENQUEUEMIGRATEMEMO(3clc)

Parameters

command_queue
           A valid command-queue. The specified set of memory objects in mem_objects will be migrated to the
           OpenCL device associated with command_queue or to the host if the CL_MIGRATE_MEM_OBJECT_HOST has been
           specified.

        num_mem_objects
           The number of memory objects specified in mem_objects.

        mem_objects
           A pointer to a list of memory objects.

        flags
           A bit-field that is used to specify migration options. The table below describes the possible values
           for flags.
           ┌────────────────────────────┬───────────────────────────────────────┐
           │ cl_mem_migrationflagsDescription                           │
           ├────────────────────────────┼───────────────────────────────────────┤
           │ CL_MIGRATE_MEM_OBJECT_HOST │ This flag indicates that the          │
           │                            │ specified set of memory objects are   │
           │                            │ to be migrated to the host,           │
           │                            │ regardless of the target              │
           │                            │ command-queue.                        │
           ├────────────────────────────┼───────────────────────────────────────┤
           │ CL_MIGRATE_MEM_OBJECT_-    │ This flag indicates that the contents │
           │ CONTENT_UNDEFINED          │ of the set of memory objects are      │
           │                            │ undefined after migration.  The       │
           │                            │ specified set of memory objects are   │
           │                            │ migrated to the device associated     │
           │                            │ with command_queue without incurring  │
           │                            │ the overhead of migrating their       │
           │                            │ contents.                             │
           └────────────────────────────┴───────────────────────────────────────┘

        event_wait_list,num_events_in_wait_list
           Specify events that need to complete before this particular command can be executed. If
           event_wait_list is NULL, then this particular command does not wait on any event to complete. If
           event_wait_list is NULL, num_events_in_wait_list must be 0. If event_wait_list is not NULL, the list
           of events pointed to by event_wait_list must be valid and num_events_in_wait_list must be greater
           than 0. The events specified in event_wait_list act as synchronization points. The context associated
           with events in event_wait_list and command_queue must be the same. The memory associated with
           event_wait_list can be reused or freed after the function returns.

        event
           Returns an event object that identifies this particular command and can be used to query or queue a
           wait for this particular command to complete.  event can be NULL in which case it will not be
           possible for the application to query the status of this command or queue a wait for this command to
           complete. If the event_wait_list and the event arguments are not NULL, the event argument should not
           refer to an element of the event_wait_list array.

See Also

clEnqueueMapBuffer(3clc), clEnqueueMapImage(3clc)

Specification

OpenCLSpecification[1]

See Also