Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UR] Add support for bidirectional USM prefetching #2312

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1e5218c
Actually implement USM migration flags
ianayl Oct 31, 2024
ca43f93
CUDA: add migration flag logic
ianayl Nov 5, 2024
90110bf
add preliminary testing -- BROKEN MATCH
ianayl Nov 8, 2024
fceb1a7
Fix CUDA conformance enqueue match patterns
ianayl Nov 11, 2024
8cfd770
Add hip adapter for urEnqueueUSMPrefetch
ianayl Nov 13, 2024
27b45d5
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Nov 13, 2024
7d5a8de
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Nov 13, 2024
fb02dac
Fix migration_flags yml spec
ianayl Nov 13, 2024
026c203
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Nov 19, 2024
a502a6e
Re-enable cl usm prefetch
ianayl Nov 19, 2024
287a6dd
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Nov 20, 2024
8cd3d7c
redisable opencl prefetch
ianayl Nov 20, 2024
37b7fa7
Rewrite OCL urEnqueueUSMPrefetch
ianayl Nov 21, 2024
4dca816
Add warnings, fix bug with legacy mapCLErrorToUR
ianayl Nov 21, 2024
5811a5b
Remove duplicate line
ianayl Nov 22, 2024
bec723b
Remove duplicate line
ianayl Nov 22, 2024
b70c04d
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Nov 28, 2024
698f896
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Nov 29, 2024
283dffb
Fix ctest errors
ianayl Dec 3, 2024
e194ae0
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 3, 2024
5669cdf
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 4, 2024
2143085
Add handling for unsupported prefetch combinations
ianayl Dec 10, 2024
c1dcb31
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 10, 2024
6a9b4e5
Added warning messages and cleaned up code
ianayl Dec 11, 2024
869a089
enforce column width
ianayl Dec 11, 2024
0030f67
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 11, 2024
491cf05
Fixed bug in hip
ianayl Dec 11, 2024
260322e
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 12, 2024
65ca774
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 13, 2024
8e819c2
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 16, 2024
ff19760
Update testing for command buffer
ianayl Dec 20, 2024
0f9407c
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 20, 2024
3aa5249
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Dec 23, 2024
17c485e
Fix issue with command dependencies
ianayl Jan 6, 2025
911679a
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Jan 7, 2025
88390f2
Merge branch 'main' of https://github.com/oneapi-src/unified-runtime …
ianayl Jan 7, 2025
dd11f85
Fix issue with disregarding event dependencies
ianayl Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -6934,17 +6934,18 @@ typedef enum ur_map_flag_t {
#define UR_MAP_FLAGS_MASK 0xfffffff8

///////////////////////////////////////////////////////////////////////////////
/// @brief Map flags
/// @brief USM migration flags, indicating the direction data is migrated in
typedef uint32_t ur_usm_migration_flags_t;
typedef enum ur_usm_migration_flag_t {
UR_USM_MIGRATION_FLAG_DEFAULT = UR_BIT(0), ///< Default migration TODO: Add more enums!
UR_USM_MIGRATION_FLAG_HOST_TO_DEVICE = UR_BIT(0), ///< Migrate data from host to device
UR_USM_MIGRATION_FLAG_DEVICE_TO_HOST = UR_BIT(1), ///< Migrate data from device to host
/// @cond
UR_USM_MIGRATION_FLAG_FORCE_UINT32 = 0x7fffffff
/// @endcond

} ur_usm_migration_flag_t;
/// @brief Bit Mask for validating ur_usm_migration_flags_t
#define UR_USM_MIGRATION_FLAGS_MASK 0xfffffffe
#define UR_USM_MIGRATION_FLAGS_MASK 0xfffffffc

///////////////////////////////////////////////////////////////////////////////
/// @brief Enqueue a command to map a region of the buffer object into the host
Expand Down Expand Up @@ -7179,7 +7180,7 @@ urEnqueueUSMPrefetch(
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
const void *pMem, ///< [in][bounds(0, size)] pointer to the USM memory object
size_t size, ///< [in] size in bytes to be fetched
ur_usm_migration_flags_t flags, ///< [in] USM prefetch flags
ur_usm_migration_flags_t flags, ///< [in] USM migration flags
uint32_t numEventsInWaitList, ///< [in] size of the event wait list
const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
///< events that must be complete before this command can be executed.
Expand Down Expand Up @@ -9157,7 +9158,7 @@ urCommandBufferAppendUSMPrefetchExp(
ur_exp_command_buffer_handle_t hCommandBuffer, ///< [in] handle of the command-buffer object.
const void *pMemory, ///< [in] pointer to USM allocated memory to prefetch.
size_t size, ///< [in] size in bytes to be fetched.
ur_usm_migration_flags_t flags, ///< [in] USM prefetch flags
ur_usm_migration_flags_t flags, ///< [in] USM migration flags
uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on. May
///< be ignored if command-buffer is in-order.
Expand Down
Loading
Loading