@@ -4648,7 +4648,7 @@ urEnqueueMemUnmap(
46484648);
46494649
46504650///////////////////////////////////////////////////////////////////////////////
4651- /// @brief Enqueue a command to set USM memory object value
4651+ /// @brief Enqueue a command to fill USM memory.
46524652///
46534653/// @returns
46544654/// - ::UR_RESULT_SUCCESS
@@ -4658,11 +4658,16 @@ urEnqueueMemUnmap(
46584658/// + `NULL == hQueue`
46594659/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
46604660/// + `NULL == ptr`
4661+ /// + `NULL == pPattern`
46614662/// - ::UR_RESULT_ERROR_INVALID_QUEUE
46624663/// - ::UR_RESULT_ERROR_INVALID_EVENT
46634664/// - ::UR_RESULT_ERROR_INVALID_SIZE
4664- /// + `count == 0`
4665- /// + If `count` is higher than the allocation size of `ptr`
4665+ /// + `size == 0`
4666+ /// + `size % patternSize != 0`
4667+ /// + `patternSize == 0`
4668+ /// + `patternSize > size`
4669+ /// + `patternSize != 0 && ((patternSize & (patternSize - 1)) != 0)`
4670+ /// + If `size` is higher than the allocation size of `ptr`
46664671/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
46674672/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
46684673/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
@@ -4671,12 +4676,13 @@ urEnqueueMemUnmap(
46714676/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
46724677/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
46734678UR_APIEXPORT ur_result_t UR_APICALL
4674- urEnqueueUSMMemset (
4679+ urEnqueueUSMFill (
46754680 ur_queue_handle_t hQueue , ///< [in] handle of the queue object
46764681 void * ptr , ///< [in] pointer to USM memory object
4677- int value , ///< [in] value to fill. It is interpreted as an 8-bit value and the upper
4678- ///< 24 bits are ignored
4679- size_t count , ///< [in] size in bytes to be set
4682+ size_t patternSize , ///< [in] the size in bytes of the pattern. Must be a power of 2 and less
4683+ ///< than or equal to width.
4684+ const void * pPattern , ///< [in] pointer with the bytes of the pattern to set.
4685+ size_t size , ///< [in] size in bytes to be set. Must be a multiple of patternSize.
46804686 uint32_t numEventsInWaitList , ///< [in] size of the event wait list
46814687 const ur_event_handle_t * phEventWaitList , ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
46824688 ///< events that must be complete before this command can be executed.
@@ -4811,10 +4817,13 @@ urEnqueueUSMMemAdvise(
48114817/// + `NULL == pPattern`
48124818/// - ::UR_RESULT_ERROR_INVALID_SIZE
48134819/// + `pitch == 0`
4820+ /// + `pitch < width`
48144821/// + `width == 0`
4822+ /// + `width % patternSize != 0`
48154823/// + `height == 0`
4816- /// + `pitch < width`
48174824/// + `patternSize == 0`
4825+ /// + `patternSize > width`
4826+ /// + `patternSize != 0 && ((patternSize & (patternSize - 1)) != 0)`
48184827/// + If `pitch * height` is higher than the allocation size of `pMem`
48194828/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
48204829/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
@@ -4829,9 +4838,11 @@ urEnqueueUSMFill2D(
48294838 ur_queue_handle_t hQueue , ///< [in] handle of the queue to submit to.
48304839 void * pMem , ///< [in] pointer to memory to be filled.
48314840 size_t pitch , ///< [in] the total width of the destination memory including padding.
4832- size_t patternSize , ///< [in] the size in bytes of the pattern.
4841+ size_t patternSize , ///< [in] the size in bytes of the pattern. Must be a power of 2 and less
4842+ ///< than or equal to width.
48334843 const void * pPattern , ///< [in] pointer with the bytes of the pattern to set.
4834- size_t width , ///< [in] the width in bytes of each row to fill.
4844+ size_t width , ///< [in] the width in bytes of each row to fill. Must be a multiple of
4845+ ///< patternSize.
48354846 size_t height , ///< [in] the height of the columns to fill.
48364847 uint32_t numEventsInWaitList , ///< [in] size of the event wait list
48374848 const ur_event_handle_t * phEventWaitList , ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
@@ -4842,49 +4853,6 @@ urEnqueueUSMFill2D(
48424853 ///< particular kernel execution instance.
48434854);
48444855
4845- ///////////////////////////////////////////////////////////////////////////////
4846- /// @brief Enqueue a command to set 2D USM memory.
4847- ///
4848- /// @returns
4849- /// - ::UR_RESULT_SUCCESS
4850- /// - ::UR_RESULT_ERROR_UNINITIALIZED
4851- /// - ::UR_RESULT_ERROR_DEVICE_LOST
4852- /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
4853- /// + `NULL == hQueue`
4854- /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
4855- /// + `NULL == pMem`
4856- /// - ::UR_RESULT_ERROR_INVALID_SIZE
4857- /// + `pitch == 0`
4858- /// + `width == 0`
4859- /// + `height == 0`
4860- /// + `pitch < width`
4861- /// + `pitch * height` is higher than the memory allocation size
4862- /// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
4863- /// + `phEventWaitList == NULL && numEventsInWaitList > 0`
4864- /// + `phEventWaitList != NULL && numEventsInWaitList == 0`
4865- /// + If event objects in phEventWaitList are not valid events.
4866- /// - ::UR_RESULT_ERROR_INVALID_MEM_OBJECT
4867- /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
4868- /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
4869- /// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
4870- UR_APIEXPORT ur_result_t UR_APICALL
4871- urEnqueueUSMMemset2D (
4872- ur_queue_handle_t hQueue , ///< [in] handle of the queue to submit to.
4873- void * pMem , ///< [in] pointer to memory to be filled.
4874- size_t pitch , ///< [in] the total width of the destination memory including padding.
4875- int value , ///< [in] the value to fill into the region in pMem. It is interpreted as
4876- ///< an 8-bit value and the upper 24 bits are ignored
4877- size_t width , ///< [in] the width in bytes of each row to set.
4878- size_t height , ///< [in] the height of the columns to set.
4879- uint32_t numEventsInWaitList , ///< [in] size of the event wait list
4880- const ur_event_handle_t * phEventWaitList , ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of
4881- ///< events that must be complete before the kernel execution.
4882- ///< If nullptr, the numEventsInWaitList must be 0, indicating that no wait
4883- ///< event.
4884- ur_event_handle_t * phEvent ///< [in,out][optional] return an event object that identifies this
4885- ///< particular kernel execution instance.
4886- );
4887-
48884856///////////////////////////////////////////////////////////////////////////////
48894857/// @brief Enqueue a command to copy 2D USM memory.
48904858///
@@ -6934,27 +6902,28 @@ typedef void(UR_APICALL *ur_pfnEnqueueMemUnmapCb_t)(
69346902 void * * ppTracerInstanceUserData );
69356903
69366904///////////////////////////////////////////////////////////////////////////////
6937- /// @brief Callback function parameters for urEnqueueUSMMemset
6905+ /// @brief Callback function parameters for urEnqueueUSMFill
69386906/// @details Each entry is a pointer to the parameter passed to the function;
69396907/// allowing the callback the ability to modify the parameter's value
6940- typedef struct ur_enqueue_usm_memset_params_t {
6908+ typedef struct ur_enqueue_usm_fill_params_t {
69416909 ur_queue_handle_t * phQueue ;
69426910 void * * pptr ;
6943- int * pvalue ;
6944- size_t * pcount ;
6911+ size_t * ppatternSize ;
6912+ const void * * ppPattern ;
6913+ size_t * psize ;
69456914 uint32_t * pnumEventsInWaitList ;
69466915 const ur_event_handle_t * * pphEventWaitList ;
69476916 ur_event_handle_t * * pphEvent ;
6948- } ur_enqueue_usm_memset_params_t ;
6917+ } ur_enqueue_usm_fill_params_t ;
69496918
69506919///////////////////////////////////////////////////////////////////////////////
6951- /// @brief Callback function-pointer for urEnqueueUSMMemset
6920+ /// @brief Callback function-pointer for urEnqueueUSMFill
69526921/// @param[in] params Parameters passed to this instance
69536922/// @param[in] result Return value
69546923/// @param[in] pTracerUserData Per-Tracer user data
69556924/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data
6956- typedef void (UR_APICALL * ur_pfnEnqueueUSMMemsetCb_t )(
6957- ur_enqueue_usm_memset_params_t * params ,
6925+ typedef void (UR_APICALL * ur_pfnEnqueueUSMFillCb_t )(
6926+ ur_enqueue_usm_fill_params_t * params ,
69586927 ur_result_t result ,
69596928 void * pTracerUserData ,
69606929 void * * ppTracerInstanceUserData );
@@ -7065,34 +7034,6 @@ typedef void(UR_APICALL *ur_pfnEnqueueUSMFill2DCb_t)(
70657034 void * pTracerUserData ,
70667035 void * * ppTracerInstanceUserData );
70677036
7068- ///////////////////////////////////////////////////////////////////////////////
7069- /// @brief Callback function parameters for urEnqueueUSMMemset2D
7070- /// @details Each entry is a pointer to the parameter passed to the function;
7071- /// allowing the callback the ability to modify the parameter's value
7072- typedef struct ur_enqueue_usm_memset2_d_params_t {
7073- ur_queue_handle_t * phQueue ;
7074- void * * ppMem ;
7075- size_t * ppitch ;
7076- int * pvalue ;
7077- size_t * pwidth ;
7078- size_t * pheight ;
7079- uint32_t * pnumEventsInWaitList ;
7080- const ur_event_handle_t * * pphEventWaitList ;
7081- ur_event_handle_t * * pphEvent ;
7082- } ur_enqueue_usm_memset2_d_params_t ;
7083-
7084- ///////////////////////////////////////////////////////////////////////////////
7085- /// @brief Callback function-pointer for urEnqueueUSMMemset2D
7086- /// @param[in] params Parameters passed to this instance
7087- /// @param[in] result Return value
7088- /// @param[in] pTracerUserData Per-Tracer user data
7089- /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data
7090- typedef void (UR_APICALL * ur_pfnEnqueueUSMMemset2DCb_t )(
7091- ur_enqueue_usm_memset2_d_params_t * params ,
7092- ur_result_t result ,
7093- void * pTracerUserData ,
7094- void * * ppTracerInstanceUserData );
7095-
70967037///////////////////////////////////////////////////////////////////////////////
70977038/// @brief Callback function parameters for urEnqueueUSMMemcpy2D
70987039/// @details Each entry is a pointer to the parameter passed to the function;
@@ -7199,12 +7140,11 @@ typedef struct ur_enqueue_callbacks_t {
71997140 ur_pfnEnqueueMemImageCopyCb_t pfnMemImageCopyCb ;
72007141 ur_pfnEnqueueMemBufferMapCb_t pfnMemBufferMapCb ;
72017142 ur_pfnEnqueueMemUnmapCb_t pfnMemUnmapCb ;
7202- ur_pfnEnqueueUSMMemsetCb_t pfnUSMMemsetCb ;
7143+ ur_pfnEnqueueUSMFillCb_t pfnUSMFillCb ;
72037144 ur_pfnEnqueueUSMMemcpyCb_t pfnUSMMemcpyCb ;
72047145 ur_pfnEnqueueUSMPrefetchCb_t pfnUSMPrefetchCb ;
72057146 ur_pfnEnqueueUSMMemAdviseCb_t pfnUSMMemAdviseCb ;
72067147 ur_pfnEnqueueUSMFill2DCb_t pfnUSMFill2DCb ;
7207- ur_pfnEnqueueUSMMemset2DCb_t pfnUSMMemset2DCb ;
72087148 ur_pfnEnqueueUSMMemcpy2DCb_t pfnUSMMemcpy2DCb ;
72097149 ur_pfnEnqueueDeviceGlobalVariableWriteCb_t pfnDeviceGlobalVariableWriteCb ;
72107150 ur_pfnEnqueueDeviceGlobalVariableReadCb_t pfnDeviceGlobalVariableReadCb ;
0 commit comments