<commit_before>import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
from pycuda import gpuarray
from pylab import *
from numpy import *
from time import time
from  ..model.sample_prep import Q_space
from .approximations import wavefunction_format
import numpy 

def loadkernelsrc(name, precision='float32', defines={}):
    import os
    src = readfile(os.path.join(os.path.dirname(__file__),name))
    # The following are currently defined by cufloat.h/cudouble.h, so aren't
    # needed here.
    #defines['CUDA_KERNEL'] = 'extern "C" __global__ void'
    #defines['INLINE'] = '__inline__ __host__ __device__'
    defines = "\n".join(('#define %s %s'%(k,str(defines[k])))
                        for k in sorted(defines.keys()))
    #define sin __sinf
    #define cos __cosf
    if precision == 'float32':
        typedefs = '''
#define HAVE_CUDA
#include <lib/cufloat.h>

#define sincos __sincosf<commit_msg>mooooore minor fixes<commit_after>import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
from pycuda import gpuarray
from pylab import *
from numpy import *
from time import time
from  ..model.sample_prep import Q_space
from .approximations import wavefunction_format
import numpy 
import time

def loadkernelsrc(name, precision='float32', defines={}):
    import os
    src = readfile(os.path.join(os.path.dirname(__file__),name))
    # The following are currently defined by cufloat.h/cudouble.h, so aren't
    # needed here.
    #defines['CUDA_KERNEL'] = 'extern "C" __global__ void'
    #defines['INLINE'] = '__inline__ __host__ __device__'
    defines = "\n".join(('#define %s %s'%(k,str(defines[k])))
                        for k in sorted(defines.keys()))
    #define sin __sinf
    #define cos __cosf
    if precision == 'float32':
        typedefs = '''
#define HAVE_CUDA
#include <lib/cufloat.h>

#define sincos __sincosf
{'fraction_non_alphanumeric': 0.11035918792295679, 'fraction_numerical': 0.004164497657470068, 'mean_word_length': 3.915601023017903, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7360674', 'n_tokens_mistral': 641, 'n_tokens_neox': 620, 'n_words': 177}