def customize_compiler_for_nvcc(self):
 self.src_extensions.append('.cu')
 default_compiler_so = self.compiler_so
 super = self._compile
 def _compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
  if (os.path.splitext(src)[1] == '.cu'):
   self.set_executable('compiler_so', CUDA['nvcc'])
   postargs = extra_postargs['nvcc']
  else:
   postargs = extra_postargs['gcc']
  super(obj, src, ext, cc_args, postargs, pp_opts)
  self.compiler_so = default_compiler_so
 self._compile = _compile

def customize_compiler_for_nvcc ( self ) : self . src_extensions . append ( '.cu' ) default_compiler_so = self . compiler_so super = self . _compile def _compile ( obj , src , ext , cc_args , extra_postargs , pp_opts ) : if ( os . path . splitext ( src ) [ 1 ] == '.cu' ) : self . set_executable ( 'compiler_so' , CUDA [ 'nvcc' ] ) postargs = extra_postargs [ 'nvcc' ] else : postargs = extra_postargs [ 'gcc' ] super ( obj , src , ext , cc_args , postargs , pp_opts ) self . compiler_so = default_compiler_so self . _compile = _compile
inject deep into distutils to customize how the dispatch to gcc/nvcc works .