

def compile(self, **options):
    'Perform Compliation\n\n        The valid compiler options are\n\n         *   - -g (enable generation of debugging information)\n         *   - -opt=\n         *     - 0 (disable optimizations)\n         *     - 3 (default, enable optimizations)\n         *   - -arch=\n         *     - compute_20 (default)\n         *     - compute_30\n         *     - compute_35\n         *   - -ftz=\n         *     - 0 (default, preserve denormal values, when performing\n         *          single-precision floating-point operations)\n         *     - 1 (flush denormal values to zero, when performing\n         *          single-precision floating-point operations)\n         *   - -prec-sqrt=\n         *     - 0 (use a faster approximation for single-precision\n         *          floating-point square root)\n         *     - 1 (default, use IEEE round-to-nearest mode for\n         *          single-precision floating-point square root)\n         *   - -prec-div=\n         *     - 0 (use a faster approximation for single-precision\n         *          floating-point division and reciprocals)\n         *     - 1 (default, use IEEE round-to-nearest mode for\n         *          single-precision floating-point division and reciprocals)\n         *   - -fma=\n         *     - 0 (disable FMA contraction)\n         *     - 1 (default, enable FMA contraction)\n         *\n         '
    opts = []
    if options.get('debug'):
        opts.append('-g')
        options.pop('debug')
    if options.get('opt'):
        opts.append(('-opt=%d' % options.pop('opt')))
    if options.get('arch'):
        opts.append(('-arch=%s' % options.pop('arch')))
    other_options = ('ftz', 'prec_sqrt', 'prec_div', 'fma')
    for k in other_options:
        if (k in options):
            v = int(bool(options.pop(k)))
            opts.append(('-%s=%d' % (k.replace('_', '-'), v)))
    if options:
        optstr = ', '.join(map(repr, options.keys()))
        raise NvvmError('unsupported option {0}'.format(optstr))
    c_opts = (c_char_p * len(opts))(*[c_char_p(x.encode('utf8')) for x in opts])
    err = self.driver.nvvmCompileProgram(self._handle, len(opts), c_opts)
    self._try_error(err, 'Failed to compile\n')
    reslen = c_size_t()
    err = self.driver.nvvmGetCompiledResultSize(self._handle, byref(reslen))
    self._try_error(err, 'Failed to get size of compiled result.')
    ptxbuf = (c_char * reslen.value)()
    err = self.driver.nvvmGetCompiledResult(self._handle, ptxbuf)
    self._try_error(err, 'Failed to get compiled result.')
    self.log = self.get_log()
    return ptxbuf[:]

dataset/ETHPy150Open numba/numba/numba/cuda/cudadrv/nvvm.py CompilationUnit.compile/original