2121namespace ur ::level_zero {
2222
2323ur_result_t urContextCreate (
24- uint32_t DeviceCount, // /< [in] the number of devices given in phDevices
25- const ur_device_handle_t
26- *Devices, // /< [in][range(0, DeviceCount)] array of handle of devices.
27- const ur_context_properties_t
28- *Properties, // /< [in][optional] pointer to context creation properties.
29- ur_context_handle_t
30- *RetContext // /< [out] pointer to handle of context object created
31- ) {
24+ // / [in] the number of devices given in phDevices
25+ uint32_t DeviceCount,
26+ // / [in][range(0, DeviceCount)] array of handle of devices.
27+ const ur_device_handle_t *Devices,
28+ // / [in][optional] pointer to context creation properties.
29+ const ur_context_properties_t *Properties,
30+ // / [out] pointer to handle of context object created
31+ ur_context_handle_t *RetContext ) {
3232 std::ignore = Properties;
3333
3434 ur_platform_handle_t Platform = Devices[0 ]->Platform ;
@@ -58,16 +58,16 @@ ur_result_t urContextCreate(
5858}
5959
6060ur_result_t urContextRetain (
61- ur_context_handle_t
62- Context // /< [in] handle of the context to get a reference of.
63- ) {
61+
62+ // / [in] handle of the context to get a reference of.
63+ ur_context_handle_t Context ) {
6464 Context->RefCount .increment ();
6565 return UR_RESULT_SUCCESS;
6666}
6767
6868ur_result_t urContextRelease (
69- ur_context_handle_t Context // /< [in] handle of the context to release.
70- ) {
69+ // / [in] handle of the context to release.
70+ ur_context_handle_t Context ) {
7171 ur_platform_handle_t Plt = Context->getPlatform ();
7272 std::unique_lock<ur_shared_mutex> ContextsLock (Plt->ContextsMutex ,
7373 std::defer_lock);
@@ -90,18 +90,20 @@ static const bool UseMemcpy2DOperations = [] {
9090}();
9191
9292ur_result_t urContextGetInfo (
93- ur_context_handle_t Context, // /< [in] handle of the context
94- ur_context_info_t ContextInfoType, // /< [in] type of the info to retrieve
95- size_t PropSize, // /< [in] the number of bytes of memory pointed to by
96- // /< pContextInfo.
97- void *ContextInfo, // /< [out][optional] array of bytes holding the info.
98- // /< if propSize is not equal to or greater than the
99- // /< real number of bytes needed to return the info then
100- // /< the ::UR_RESULT_ERROR_INVALID_SIZE error is
101- // /< returned and pContextInfo is not used.
102- size_t *PropSizeRet // /< [out][optional] pointer to the actual size in
103- // /< bytes of data queried by ContextInfoType.
104- ) {
93+ // / [in] handle of the context
94+ ur_context_handle_t Context,
95+ // / [in] type of the info to retrieve
96+ ur_context_info_t ContextInfoType,
97+ // / [in] the number of bytes of memory pointed to by pContextInfo.
98+ size_t PropSize,
99+ // / [out][optional] array of bytes holding the info. if propSize is not
100+ // / equal to or greater than the real number of bytes needed to return the
101+ // / info then the ::UR_RESULT_ERROR_INVALID_SIZE error is returned and
102+ // / pContextInfo is not used.
103+ void *ContextInfo,
104+ // / [out][optional] pointer to the actual size in bytes of data queried by
105+ // / ContextInfoType.
106+ size_t *PropSizeRet) {
105107 std::shared_lock<ur_shared_mutex> Lock (Context->Mutex );
106108 UrReturnHelper ReturnValue (PropSize, ContextInfo, PropSizeRet);
107109 switch (
@@ -141,22 +143,22 @@ ur_result_t urContextGetInfo(
141143}
142144
143145ur_result_t urContextGetNativeHandle (
144- ur_context_handle_t Context, // /< [in] handle of the context.
145- ur_native_handle_t *NativeContext // /< [out] a pointer to the native
146- // /< handle of the context.
147- ) {
146+ // / [in] handle of the context.
147+ ur_context_handle_t Context,
148+ // / [out] a pointer to the native handle of the context.
149+ ur_native_handle_t *NativeContext ) {
148150 *NativeContext = reinterpret_cast <ur_native_handle_t >(Context->ZeContext );
149151 return UR_RESULT_SUCCESS;
150152}
151153
152154ur_result_t urContextCreateWithNativeHandle (
153155 ur_native_handle_t
154- NativeContext, // /< [in] the native handle of the context.
156+ // / [in] the native handle of the context.
157+ NativeContext,
155158 ur_adapter_handle_t , uint32_t NumDevices, const ur_device_handle_t *Devices,
156159 const ur_context_native_properties_t *Properties,
157- ur_context_handle_t
158- *Context // /< [out] pointer to the handle of the context object created.
159- ) {
160+ // / [out] pointer to the handle of the context object created.
161+ ur_context_handle_t *Context) {
160162 bool OwnNativeHandle = Properties->isNativeHandleOwned ;
161163 try {
162164 ze_context_handle_t ZeContext =
@@ -174,12 +176,12 @@ ur_result_t urContextCreateWithNativeHandle(
174176}
175177
176178ur_result_t urContextSetExtendedDeleter (
177- ur_context_handle_t Context, // /< [in] handle of the context.
178- ur_context_extended_deleter_t
179- Deleter, // /< [in] Function pointer to extended deleter.
180- void *UserData // /< [in][out][optional] pointer to data to be passed to
181- // /< callback.
182- ) {
179+ // / [in] handle of the context.
180+ ur_context_handle_t Context,
181+ // / [in] Function pointer to extended deleter.
182+ ur_context_extended_deleter_t Deleter,
183+ // / [in][out][optional] pointer to data to be passed to callback.
184+ void *UserData ) {
183185 std::ignore = Context;
184186 std::ignore = Deleter;
185187 std::ignore = UserData;
0 commit comments