@@ -210,12 +210,11 @@ class ET_EXPERIMENTAL CudaBackend final
210210
211211 // Load constant management symbols (optional — needed for cross-method
212212 // buffer sharing). These are available in torch >= 2.6.
213- #define LOAD_OPTIONAL_SYMBOL (member, name ) \
214- do { \
215- auto res = get_function (so_handle, #name); \
216- handle->member = res.ok () \
217- ? reinterpret_cast <name##Func>(res.get ()) \
218- : nullptr ; \
213+ #define LOAD_OPTIONAL_SYMBOL (member, name ) \
214+ do { \
215+ auto res = get_function (so_handle, #name); \
216+ handle->member = \
217+ res.ok () ? reinterpret_cast <name##Func>(res.get ()) : nullptr ; \
219218 } while (0 )
220219
221220 LOAD_OPTIONAL_SYMBOL (
@@ -226,8 +225,7 @@ class ET_EXPERIMENTAL CudaBackend final
226225 get_constant_original_fqn,
227226 AOTInductorModelContainerGetConstantOriginalFQN);
228227 LOAD_OPTIONAL_SYMBOL (
229- extract_constants_map,
230- AOTInductorModelContainerExtractConstantsMap);
228+ extract_constants_map, AOTInductorModelContainerExtractConstantsMap);
231229 LOAD_OPTIONAL_SYMBOL (
232230 update_user_managed_constant_buffer_pairs,
233231 AOTInductorModelContainerUpdateUserManagedConstantBufferPairs);
@@ -426,8 +424,7 @@ class ET_EXPERIMENTAL CudaBackend final
426424 const char * name = nullptr ;
427425 const char * fqn = nullptr ;
428426 handle->get_constant_name (handle->container_handle , i, &name);
429- handle->get_constant_original_fqn (
430- handle->container_handle , i, &fqn);
427+ handle->get_constant_original_fqn (handle->container_handle , i, &fqn);
431428 if (name && fqn && fqn[0 ] != ' \0 ' ) {
432429 fqn_to_name[fqn] = name;
433430 }
@@ -451,11 +448,16 @@ class ET_EXPERIMENTAL CudaBackend final
451448 }
452449 }
453450 constants_extracted_ = true ;
454- ET_LOG (Info, " Extracted %zu shared constants from method '%s'" ,
455- shared_constant_tensors_.size (), method_name.c_str ());
451+ ET_LOG (
452+ Info,
453+ " Extracted %zu shared constants from method '%s'" ,
454+ shared_constant_tensors_.size (),
455+ method_name.c_str ());
456456 } else {
457- ET_LOG (Error, " Failed to extract constants from '%s'" ,
458- method_name.c_str ());
457+ ET_LOG (
458+ Error,
459+ " Failed to extract constants from '%s'" ,
460+ method_name.c_str ());
459461 }
460462 } else {
461463 // Subsequent container: share matching constants from the first.
@@ -470,27 +472,33 @@ class ET_EXPERIMENTAL CudaBackend final
470472 }
471473
472474 if (!pairs.empty ()) {
473- auto update_err =
474- handle->update_user_managed_constant_buffer_pairs (
475- handle->container_handle ,
476- pairs.data (),
477- pairs.size (),
478- /* use_inactive=*/ false ,
479- /* validate_full_update=*/ false );
475+ auto update_err = handle->update_user_managed_constant_buffer_pairs (
476+ handle->container_handle ,
477+ pairs.data (),
478+ pairs.size (),
479+ /* use_inactive=*/ false ,
480+ /* validate_full_update=*/ false );
480481
481482 if (update_err == Error::Ok) {
482- ET_LOG (Info, " Shared %zu constants into method '%s'" ,
483- pairs.size (), method_name.c_str ());
483+ ET_LOG (
484+ Info,
485+ " Shared %zu constants into method '%s'" ,
486+ pairs.size (),
487+ method_name.c_str ());
484488 } else {
485- ET_LOG (Error, " Failed to share constants into '%s'" ,
486- method_name.c_str ());
489+ ET_LOG (
490+ Error,
491+ " Failed to share constants into '%s'" ,
492+ method_name.c_str ());
487493 }
488494 }
489495 }
490496 }
491497 } else {
492- ET_LOG (Info, " Constant sharing APIs not available for method '%s'" ,
493- method_name.c_str ());
498+ ET_LOG (
499+ Info,
500+ " Constant sharing APIs not available for method '%s'" ,
501+ method_name.c_str ());
494502 }
495503
496504 return (DelegateHandle*)handle; // Return the handle post-processing
0 commit comments