@@ -29,7 +29,6 @@ def _lazy_init():
29
29
_driver_ver = handle_return (cuda .cuDriverGetVersion ())
30
30
_driver_ver = (_driver_ver // 1000 , (_driver_ver % 1000 ) // 10 )
31
31
try :
32
- raise ImportError
33
32
from cuda .bindings import nvjitlink
34
33
from cuda .bindings ._internal import nvjitlink as inner_nvjitlink
35
34
except ImportError :
@@ -247,7 +246,7 @@ def _init_nvjitlink(self):
247
246
self .formatted_options .append (f"-split-compile={ self .split_compile } " )
248
247
if self .split_compile_extended is not None :
249
248
self .formatted_options .append (f"-split-compile-extended={ self .split_compile_extended } " )
250
- if self .no_cache is not None :
249
+ if self .no_cache is True :
251
250
self .formatted_options .append ("-no-cache" )
252
251
253
252
def _init_driver (self ):
@@ -272,57 +271,46 @@ def _init_driver(self):
272
271
self .formatted_options .append (self .max_register_count )
273
272
self .option_keys .append (_driver .CUjit_option .CU_JIT_MAX_REGISTERS )
274
273
if self .time is not None :
275
- self .formatted_options .append (1 ) # ctypes.c_int32(1)
276
- self .option_keys .append (_driver .CUjit_option .CU_JIT_WALL_TIME )
274
+ raise ValueError ("time option is not supported by the driver API" )
277
275
if self .verbose is not None :
278
- self .formatted_options .append (1 ) # ctypes.c_int32(1)
276
+ self .formatted_options .append (1 )
279
277
self .option_keys .append (_driver .CUjit_option .CU_JIT_LOG_VERBOSE )
280
278
if self .link_time_optimization is not None :
281
- self .formatted_options .append (1 ) # ctypes.c_int32(1)
279
+ self .formatted_options .append (1 )
282
280
self .option_keys .append (_driver .CUjit_option .CU_JIT_LTO )
283
281
if self .ptx is not None :
284
- self .formatted_options .append (1 ) # ctypes.c_int32(1)
285
- self .option_keys .append (_driver .CUjit_option .CU_JIT_GENERATE_LINE_INFO )
282
+ raise ValueError ("ptx option is not supported by the driver API" )
286
283
if self .optimization_level is not None :
287
284
self .formatted_options .append (self .optimization_level )
288
285
self .option_keys .append (_driver .CUjit_option .CU_JIT_OPTIMIZATION_LEVEL )
289
286
if self .debug is not None :
290
- self .formatted_options .append (1 ) # ctypes.c_int32(1)
287
+ self .formatted_options .append (1 )
291
288
self .option_keys .append (_driver .CUjit_option .CU_JIT_GENERATE_DEBUG_INFO )
292
289
if self .lineinfo is not None :
293
- self .formatted_options .append (1 ) # ctypes.c_int32(1)
290
+ self .formatted_options .append (1 )
294
291
self .option_keys .append (_driver .CUjit_option .CU_JIT_GENERATE_LINE_INFO )
295
292
if self .ftz is not None :
296
- self .formatted_options .append (1 if self .ftz else 0 )
297
- self .option_keys .append (_driver .CUjit_option .CU_JIT_FTZ )
293
+ raise ValueError ("ftz option is deprecated in the driver API" )
298
294
if self .prec_div is not None :
299
- self .formatted_options .append (1 if self .prec_div else 0 )
300
- self .option_keys .append (_driver .CUjit_option .CU_JIT_PREC_DIV )
295
+ raise ValueError ("prec_div option is deprecated in the driver API" )
301
296
if self .prec_sqrt is not None :
302
- self .formatted_options .append (1 if self .prec_sqrt else 0 )
303
- self .option_keys .append (_driver .CUjit_option .CU_JIT_PREC_SQRT )
297
+ raise ValueError ("prec_sqrt option is deprecated in the driver API" )
304
298
if self .fma is not None :
305
- self .formatted_options .append (1 if self .fma else 0 )
306
- self .option_keys .append (_driver .CUjit_option .CU_JIT_FMA )
299
+ raise ValueError ("fma options is deprecated in the driver API" )
307
300
if self .kernels_used is not None :
308
- for kernel in self .kernels_used :
309
- self .formatted_options .append (kernel .encode ())
310
- self .option_keys .append (_driver .CUjit_option .CU_JIT_REFERENCED_KERNEL_NAMES )
301
+ raise ValueError ("kernels_used is deprecated in the driver API" )
311
302
if self .variables_used is not None :
312
- for variable in self .variables_used :
313
- self .formatted_options .append (variable .encode ())
314
- self .option_keys .append (_driver .CUjit_option .CU_JIT_REFERENCED_VARIABLE_NAMES )
303
+ raise ValueError ("variables_used is deprecated in the driver API" )
315
304
if self .optimize_unused_variables is not None :
316
- self .formatted_options .append (1 ) # ctypes.c_int32(1)
317
- self .option_keys .append (_driver .CUjit_option .CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES )
305
+ raise ValueError ("optimize_unused_variables is deprecated in the driver API" )
318
306
if self .xptxas is not None :
319
- for opt in self .xptxas :
320
- raise NotImplementedError ("TODO: implement xptxas option" )
307
+ raise ValueError ("xptxas option is not supported by the driver API" )
308
+ if self .split_compile is not None :
309
+ raise ValueError ("split_compile option is not supported by the driver API" )
321
310
if self .split_compile_extended is not None :
322
- self .formatted_options .append (self .split_compile_extended )
323
- self .option_keys .append (_driver .CUjit_option .CU_JIT_MIN_CTA_PER_SM )
311
+ raise ValueError ("split_compile_extended option is not supported by the driver API" )
324
312
if self .no_cache is not None :
325
- self .formatted_options .append (1 ) # ctypes.c_int32(1 )
313
+ self .formatted_options .append (_driver . CUjit_cacheMode . CU_JIT_CACHE_OPTION_NONE )
326
314
self .option_keys .append (_driver .CUjit_option .CU_JIT_CACHE_MODE )
327
315
328
316
0 commit comments