-
Notifications
You must be signed in to change notification settings - Fork 709
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
[SYCL] Implement sycl_ext_oneapi_memcpy2d extension #7370
Conversation
This commit adds an implementation of the sycl_ext_oneapi_memcpy2d extension. This includes the following: * Three new PI API functions; piextUSMEnqueueFill2D, piextUSMEnqueueMemset2D, and piextUSMEnqueueMemcpy2D. * Three new PI context queries; PI_EXT_ONEAPI_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT, PI_EXT_ONEAPI_CONTEXT_INFO_USM_FILL2D_SUPPORT, and PI_EXT_ONEAPI_CONTEXT_INFO_USM_MEMSET2D_SUPPORT. Each of these return a boolean value signifying if the PI context supports each of the new API functions. * New handler member functions; ext_oneapi_memcpy2d, ext_oneapi_copy2d, ext_oneapi_memset2d, and ext_oneapi_fill2d. These will create new commands which will use the new PI commands if they are supported. If the new PI API functions are not supported, these member functions will launch auxiliary kernels to do the required work. * New queue shortcuts for each of the new handler members. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
PI_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 0x10011 | ||
PI_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 0x10011, | ||
// Native 2D USM memory operation support | ||
PI_EXT_ONEAPI_CONTEXT_INFO_USM_FILL2D_SUPPORT = 0x30000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, why 0x30000
and not 0x20000
, for example? Is it documented anywhere which values should be picked up for new capabilities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have any rules necessarily. All these values are taken from OpenCL so we normally just try and move around what values are in OpenCL when adding extension values. In theory it should be fine as long as they don't conflict with any values in the same category, but it's good to keep a buffer.
@@ -1930,6 +1930,23 @@ pi_result piextUSMEnqueueMemAdvise(pi_queue, const void *, size_t, | |||
DIE_NO_IMPLEMENTATION; | |||
} | |||
|
|||
pi_result piextUSMEnqueueFill2D(pi_queue, void *, size_t, size_t, const void *, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about get info for ESIMD Emulator plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
piContextGetInfo
isn't implemented in the esimd_emulator, so I assume it takes another route.
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
/verify with intel/llvm-test-suite#1379 |
@intel/llvm-reviewers-cuda | @intel/dpcpp-esimd-reviewers | @intel/dpcpp-l0-pi-reviewers | @intel/llvm-reviewers-runtime - Friendly ping. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor comments aside, LGTM. @intel/dpcpp-l0-pi-reviewers Could you please take a look as well?
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L0 plugin changes look good to me.
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am temporarily blocking the merge until this is reviewed/approved for Unified Runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made oneapi-src/unified-runtime#83 to ensure we track these changes in the unified runtime spec.
Co-authored-by: Petr Vesely <veselypeta@gmail.com>
Co-authored-by: Petr Vesely <veselypeta@gmail.com>
/// \param num_events_in_waitlist is the number of events to wait on | ||
/// \param events_waitlist is an array of events to wait on | ||
/// \param event is the event that represents this operation | ||
__SYCL_EXPORT pi_result piextUSMEnqueueFill2D(pi_queue queue, void *ptr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The similar "buffer" API use "Rect" instead of "2D". I think we should unify names if possible (especially for Unified Runtime). Tag @kbenzie
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@veselypeta this is relevant to oneapi-src/unified-runtime#107
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smaslov-intel the difference with *Rect
though is they support 2D or 3D where as this is only 2D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it not make sense to add 3D for USM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3D could make sense, that would be outside of the scope of this extension though.
I'm less sure if combining the 2D and 3D entry points into a rect entry point is the right way to go though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we were to split 2D/3D then maybe we should do the same to the existing Rect API four buffers
OK, this discussion belongs to Unified Runtime issue, I guess
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
/verify with intel/llvm-test-suite#1379 |
Failures: OpenCL: Timed Out Tests (5): #7741 ??, also failed in http://icl-jenkins2.sc.intel.com:8080/blue/organizations/jenkins/SYCL_CI%2Fintel%2FWin%2FTest_Suite/detail/Test_Suite/2260/pipeline/298/ Failed Tests (2): ??, but I'm sure I've seen it elsewhere in the last day or two. Level Zero: Timed Out Tests (2): Failed Tests (19): #7744 #7743 |
intel#7370 implemented the proposed sycl_ext_oneapi_memcpy2d extension. With that PR merged we can now move the extension specification to supported. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
#7370 implemented the proposed sycl_ext_oneapi_memcpy2d extension. With that PR merged we can now move the extension specification to supported. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
This commit adds an implementation of the sycl_ext_oneapi_memcpy2d extension. This includes the following: