File tree Expand file tree Collapse file tree
cuda_core/cuda/core/experimental Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,15 +205,15 @@ def _init_nvjitlink(self):
205205 self .formatted_options .append ("-time" )
206206 if self .verbose is not None :
207207 self .formatted_options .append ("-verbose" )
208- if self .link_time_optimization is not None :
208+ if self .link_time_optimization is not None and self . link_time_optimization :
209209 self .formatted_options .append ("-lto" )
210210 if self .ptx is not None :
211211 self .formatted_options .append ("-ptx" )
212212 if self .optimization_level is not None :
213213 self .formatted_options .append (f"-O{ self .optimization_level } " )
214- if self .debug is not None :
214+ if self .debug is not None and self . debug :
215215 self .formatted_options .append ("-g" )
216- if self .lineinfo is not None :
216+ if self .lineinfo is not None and self . lineinfo :
217217 self .formatted_options .append ("-lineinfo" )
218218 if self .ftz is not None :
219219 self .formatted_options .append (f"-ftz={ 'true' if self .ftz else 'false' } " )
Original file line number Diff line number Diff line change @@ -244,8 +244,8 @@ def __post_init__(self):
244244 self ._formatted_options .append ("--device-debug" )
245245 if self .lineinfo is not None and self .lineinfo :
246246 self ._formatted_options .append ("--generate-line-info" )
247- if self .device_code_optimize is not None :
248- self ._formatted_options .append (f "--dopt={ 'on' if self . device_code_optimize else 'off' } " )
247+ if self .device_code_optimize is not None and self . device_code_optimize :
248+ self ._formatted_options .append ("--dopt=on " )
249249 if self .ptxas_options is not None :
250250 opt_name = "--ptxas-options"
251251 if isinstance (self .ptxas_options , str ):
@@ -351,7 +351,7 @@ def _as_bytes(self):
351351
352352 def __repr__ (self ):
353353 # __TODO__ improve this
354- return self ._formatted_options
354+ return str ( self ._formatted_options )
355355
356356
357357ProgramHandleT = Union ["cuda.bindings.nvrtc.nvrtcProgram" , LinkerHandleT ]
You can’t perform that action at this time.
0 commit comments